//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension DirectoryService {
    // MARK: Enums

    public enum CertificateState: String, CustomStringConvertible, Codable, _SotoSendable {
        case deregisterFailed = "DeregisterFailed"
        case deregistered = "Deregistered"
        case deregistering = "Deregistering"
        case registerFailed = "RegisterFailed"
        case registered = "Registered"
        case registering = "Registering"
        public var description: String { return self.rawValue }
    }

    public enum CertificateType: String, CustomStringConvertible, Codable, _SotoSendable {
        case clientCertAuth = "ClientCertAuth"
        case clientLdaps = "ClientLDAPS"
        public var description: String { return self.rawValue }
    }

    public enum ClientAuthenticationStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "Disabled"
        case enabled = "Enabled"
        public var description: String { return self.rawValue }
    }

    public enum ClientAuthenticationType: String, CustomStringConvertible, Codable, _SotoSendable {
        case smartCard = "SmartCard"
        case smartCardOrPassword = "SmartCardOrPassword"
        public var description: String { return self.rawValue }
    }

    public enum DirectoryConfigurationStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case `default` = "Default"
        case failed = "Failed"
        case requested = "Requested"
        case updated = "Updated"
        case updating = "Updating"
        public var description: String { return self.rawValue }
    }

    public enum DirectoryEdition: String, CustomStringConvertible, Codable, _SotoSendable {
        case enterprise = "Enterprise"
        case standard = "Standard"
        public var description: String { return self.rawValue }
    }

    public enum DirectorySize: String, CustomStringConvertible, Codable, _SotoSendable {
        case large = "Large"
        case small = "Small"
        public var description: String { return self.rawValue }
    }

    public enum DirectoryStage: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "Active"
        case created = "Created"
        case creating = "Creating"
        case deleted = "Deleted"
        case deleting = "Deleting"
        case failed = "Failed"
        case impaired = "Impaired"
        case inoperable = "Inoperable"
        case requested = "Requested"
        case restorefailed = "RestoreFailed"
        case restoring = "Restoring"
        public var description: String { return self.rawValue }
    }

    public enum DirectoryType: String, CustomStringConvertible, Codable, _SotoSendable {
        case adConnector = "ADConnector"
        case microsoftAd = "MicrosoftAD"
        case sharedMicrosoftAd = "SharedMicrosoftAD"
        case simpleAd = "SimpleAD"
        public var description: String { return self.rawValue }
    }

    public enum DomainControllerStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "Active"
        case creating = "Creating"
        case deleted = "Deleted"
        case deleting = "Deleting"
        case failed = "Failed"
        case impaired = "Impaired"
        case restoring = "Restoring"
        public var description: String { return self.rawValue }
    }

    public enum IpRouteStatusMsg: String, CustomStringConvertible, Codable, _SotoSendable {
        case addFailed = "AddFailed"
        case added = "Added"
        case adding = "Adding"
        case removeFailed = "RemoveFailed"
        case removed = "Removed"
        case removing = "Removing"
        public var description: String { return self.rawValue }
    }

    public enum LDAPSStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "Disabled"
        case enableFailed = "EnableFailed"
        case enabled = "Enabled"
        case enabling = "Enabling"
        public var description: String { return self.rawValue }
    }

    public enum LDAPSType: String, CustomStringConvertible, Codable, _SotoSendable {
        case client = "Client"
        public var description: String { return self.rawValue }
    }

    public enum OSVersion: String, CustomStringConvertible, Codable, _SotoSendable {
        case version2012 = "SERVER_2012"
        case version2019 = "SERVER_2019"
        public var description: String { return self.rawValue }
    }

    public enum RadiusAuthenticationProtocol: String, CustomStringConvertible, Codable, _SotoSendable {
        case chap = "CHAP"
        case mschapv1 = "MS-CHAPv1"
        case mschapv2 = "MS-CHAPv2"
        case pap = "PAP"
        public var description: String { return self.rawValue }
    }

    public enum RadiusStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case completed = "Completed"
        case creating = "Creating"
        case failed = "Failed"
        public var description: String { return self.rawValue }
    }

    public enum RegionType: String, CustomStringConvertible, Codable, _SotoSendable {
        case additional = "Additional"
        case primary = "Primary"
        public var description: String { return self.rawValue }
    }

    public enum ReplicationScope: String, CustomStringConvertible, Codable, _SotoSendable {
        case domain = "Domain"
        public var description: String { return self.rawValue }
    }

    public enum SchemaExtensionStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case cancelInProgress = "CancelInProgress"
        case cancelled = "Cancelled"
        case completed = "Completed"
        case creatingSnapshot = "CreatingSnapshot"
        case failed = "Failed"
        case initializing = "Initializing"
        case replicating = "Replicating"
        case rollbackInProgress = "RollbackInProgress"
        case updatingSchema = "UpdatingSchema"
        public var description: String { return self.rawValue }
    }

    public enum SelectiveAuth: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "Disabled"
        case enabled = "Enabled"
        public var description: String { return self.rawValue }
    }

    public enum ShareMethod: String, CustomStringConvertible, Codable, _SotoSendable {
        case handshake = "HANDSHAKE"
        case organizations = "ORGANIZATIONS"
        public var description: String { return self.rawValue }
    }

    public enum ShareStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case deleted = "Deleted"
        case deleting = "Deleting"
        case pendingAcceptance = "PendingAcceptance"
        case rejectFailed = "RejectFailed"
        case rejected = "Rejected"
        case rejecting = "Rejecting"
        case shareFailed = "ShareFailed"
        case shared = "Shared"
        case sharing = "Sharing"
        public var description: String { return self.rawValue }
    }

    public enum SnapshotStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case completed = "Completed"
        case creating = "Creating"
        case failed = "Failed"
        public var description: String { return self.rawValue }
    }

    public enum SnapshotType: String, CustomStringConvertible, Codable, _SotoSendable {
        case auto = "Auto"
        case manual = "Manual"
        public var description: String { return self.rawValue }
    }

    public enum TargetType: String, CustomStringConvertible, Codable, _SotoSendable {
        case account = "ACCOUNT"
        public var description: String { return self.rawValue }
    }

    public enum TopicStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case deleted = "Deleted"
        case failed = "Failed"
        case registered = "Registered"
        case topicNotFound = "Topic not found"
        public var description: String { return self.rawValue }
    }

    public enum TrustDirection: String, CustomStringConvertible, Codable, _SotoSendable {
        case oneWayIncoming = "One-Way: Incoming"
        case oneWayOutgoing = "One-Way: Outgoing"
        case twoWay = "Two-Way"
        public var description: String { return self.rawValue }
    }

    public enum TrustState: String, CustomStringConvertible, Codable, _SotoSendable {
        case created = "Created"
        case creating = "Creating"
        case deleted = "Deleted"
        case deleting = "Deleting"
        case failed = "Failed"
        case updateFailed = "UpdateFailed"
        case updated = "Updated"
        case updating = "Updating"
        case verified = "Verified"
        case verifyFailed = "VerifyFailed"
        case verifying = "Verifying"
        public var description: String { return self.rawValue }
    }

    public enum TrustType: String, CustomStringConvertible, Codable, _SotoSendable {
        case external = "External"
        case forest = "Forest"
        public var description: String { return self.rawValue }
    }

    public enum UpdateStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case updateFailed = "UpdateFailed"
        case updated = "Updated"
        case updating = "Updating"
        public var description: String { return self.rawValue }
    }

    public enum UpdateType: String, CustomStringConvertible, Codable, _SotoSendable {
        case os = "OS"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AcceptSharedDirectoryRequest: AWSEncodableShape {
        /// Identifier of the shared directory in the directory consumer account. This identifier is different for each directory owner account.
        public let sharedDirectoryId: String

        public init(sharedDirectoryId: String) {
            self.sharedDirectoryId = sharedDirectoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.sharedDirectoryId, name: "sharedDirectoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectoryId = "SharedDirectoryId"
        }
    }

    public struct AcceptSharedDirectoryResult: AWSDecodableShape {
        /// The shared directory in the directory consumer account.
        public let sharedDirectory: SharedDirectory?

        public init(sharedDirectory: SharedDirectory? = nil) {
            self.sharedDirectory = sharedDirectory
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectory = "SharedDirectory"
        }
    }

    public struct AddIpRoutesRequest: AWSEncodableShape {
        /// Identifier (ID) of the directory to which to add the address block.
        public let directoryId: String
        /// IP address blocks, using CIDR format, of the traffic to route. This is often the IP address block of the DNS server used for your self-managed domain.
        public let ipRoutes: [IpRoute]
        /// If set to true, updates the inbound and outbound rules of the security group that has the description: "Amazon Web Services created security group for directory ID directory controllers." Following are the new rules:  Inbound:   Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0   Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0   Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0   Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0   Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0   Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0   Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0   Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0   Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0   Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0   Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0
        ///   Outbound:   Type: All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0   These security rules impact an internal network interface that is not exposed publicly.
        public let updateSecurityGroupForDirectoryControllers: Bool?

        public init(directoryId: String, ipRoutes: [IpRoute], updateSecurityGroupForDirectoryControllers: Bool? = nil) {
            self.directoryId = directoryId
            self.ipRoutes = ipRoutes
            self.updateSecurityGroupForDirectoryControllers = updateSecurityGroupForDirectoryControllers
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.ipRoutes.forEach {
                try $0.validate(name: "\(name).ipRoutes[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case ipRoutes = "IpRoutes"
            case updateSecurityGroupForDirectoryControllers = "UpdateSecurityGroupForDirectoryControllers"
        }
    }

    public struct AddIpRoutesResult: AWSDecodableShape {
        public init() {}
    }

    public struct AddRegionRequest: AWSEncodableShape {
        /// The identifier of the directory to which you want to add Region replication.
        public let directoryId: String
        /// The name of the Region where you want to add domain controllers for replication. For example, us-east-1.
        public let regionName: String
        public let vpcSettings: DirectoryVpcSettings

        public init(directoryId: String, regionName: String, vpcSettings: DirectoryVpcSettings) {
            self.directoryId = directoryId
            self.regionName = regionName
            self.vpcSettings = vpcSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.regionName, name: "regionName", parent: name, max: 32)
            try self.validate(self.regionName, name: "regionName", parent: name, min: 8)
            try self.vpcSettings.validate(name: "\(name).vpcSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case regionName = "RegionName"
            case vpcSettings = "VPCSettings"
        }
    }

    public struct AddRegionResult: AWSDecodableShape {
        public init() {}
    }

    public struct AddTagsToResourceRequest: AWSEncodableShape {
        /// Identifier (ID) for the directory to which to add the tag.
        public let resourceId: String
        /// The tags to be assigned to the directory.
        public let tags: [Tag]

        public init(resourceId: String, tags: [Tag]) {
            self.resourceId = resourceId
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^[d]-[0-9a-f]{10}$")
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceId = "ResourceId"
            case tags = "Tags"
        }
    }

    public struct AddTagsToResourceResult: AWSDecodableShape {
        public init() {}
    }

    public struct Attribute: AWSEncodableShape & AWSDecodableShape {
        /// The name of the attribute.
        public let name: String?
        /// The value of the attribute.
        public let value: String?

        public init(name: String? = nil, value: String? = nil) {
            self.name = name
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct CancelSchemaExtensionRequest: AWSEncodableShape {
        /// The identifier of the directory whose schema extension will be canceled.
        public let directoryId: String
        /// The identifier of the schema extension that will be canceled.
        public let schemaExtensionId: String

        public init(directoryId: String, schemaExtensionId: String) {
            self.directoryId = directoryId
            self.schemaExtensionId = schemaExtensionId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.schemaExtensionId, name: "schemaExtensionId", parent: name, pattern: "^e-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case schemaExtensionId = "SchemaExtensionId"
        }
    }

    public struct CancelSchemaExtensionResult: AWSDecodableShape {
        public init() {}
    }

    public struct Certificate: AWSDecodableShape {
        /// The identifier of the certificate.
        public let certificateId: String?
        /// A ClientCertAuthSettings object that contains client certificate authentication settings.
        public let clientCertAuthSettings: ClientCertAuthSettings?
        /// The common name for the certificate.
        public let commonName: String?
        /// The date and time when the certificate will expire.
        public let expiryDateTime: Date?
        /// The date and time that the certificate was registered.
        public let registeredDateTime: Date?
        /// The state of the certificate.
        public let state: CertificateState?
        /// Describes a state change for the certificate.
        public let stateReason: String?
        /// The function that the registered certificate performs. Valid values include ClientLDAPS or ClientCertAuth. The default value is ClientLDAPS.
        public let type: CertificateType?

        public init(certificateId: String? = nil, clientCertAuthSettings: ClientCertAuthSettings? = nil, commonName: String? = nil, expiryDateTime: Date? = nil, registeredDateTime: Date? = nil, state: CertificateState? = nil, stateReason: String? = nil, type: CertificateType? = nil) {
            self.certificateId = certificateId
            self.clientCertAuthSettings = clientCertAuthSettings
            self.commonName = commonName
            self.expiryDateTime = expiryDateTime
            self.registeredDateTime = registeredDateTime
            self.state = state
            self.stateReason = stateReason
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case certificateId = "CertificateId"
            case clientCertAuthSettings = "ClientCertAuthSettings"
            case commonName = "CommonName"
            case expiryDateTime = "ExpiryDateTime"
            case registeredDateTime = "RegisteredDateTime"
            case state = "State"
            case stateReason = "StateReason"
            case type = "Type"
        }
    }

    public struct CertificateInfo: AWSDecodableShape {
        /// The identifier of the certificate.
        public let certificateId: String?
        /// The common name for the certificate.
        public let commonName: String?
        /// The date and time when the certificate will expire.
        public let expiryDateTime: Date?
        /// The state of the certificate.
        public let state: CertificateState?
        /// The function that the registered certificate performs. Valid values include ClientLDAPS or ClientCertAuth. The default value is ClientLDAPS.
        public let type: CertificateType?

        public init(certificateId: String? = nil, commonName: String? = nil, expiryDateTime: Date? = nil, state: CertificateState? = nil, type: CertificateType? = nil) {
            self.certificateId = certificateId
            self.commonName = commonName
            self.expiryDateTime = expiryDateTime
            self.state = state
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case certificateId = "CertificateId"
            case commonName = "CommonName"
            case expiryDateTime = "ExpiryDateTime"
            case state = "State"
            case type = "Type"
        }
    }

    public struct ClientAuthenticationSettingInfo: AWSDecodableShape {
        /// The date and time when the status of the client authentication type was last updated.
        public let lastUpdatedDateTime: Date?
        /// Whether the client authentication type is enabled or disabled for the specified directory.
        public let status: ClientAuthenticationStatus?
        /// The type of client authentication for the specified directory. If no type is specified, a list of all client authentication types that are supported for the directory is retrieved.
        public let type: ClientAuthenticationType?

        public init(lastUpdatedDateTime: Date? = nil, status: ClientAuthenticationStatus? = nil, type: ClientAuthenticationType? = nil) {
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.status = status
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case status = "Status"
            case type = "Type"
        }
    }

    public struct ClientCertAuthSettings: AWSEncodableShape & AWSDecodableShape {
        /// Specifies the URL of the default OCSP server used to check for revocation status. A secondary value to any OCSP address found in the AIA extension of the user certificate.
        public let ocspUrl: String?

        public init(ocspUrl: String? = nil) {
            self.ocspUrl = ocspUrl
        }

        public func validate(name: String) throws {
            try self.validate(self.ocspUrl, name: "ocspUrl", parent: name, max: 1024)
            try self.validate(self.ocspUrl, name: "ocspUrl", parent: name, min: 1)
            try self.validate(self.ocspUrl, name: "ocspUrl", parent: name, pattern: "^(https?|ftp|file|ldaps?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;()]*[-a-zA-Z0-9+&@#/%=~_|()]$")
        }

        private enum CodingKeys: String, CodingKey {
            case ocspUrl = "OCSPUrl"
        }
    }

    public struct Computer: AWSDecodableShape {
        /// An array of Attribute objects containing the LDAP attributes that belong to the computer account.
        public let computerAttributes: [Attribute]?
        /// The identifier of the computer.
        public let computerId: String?
        /// The computer name.
        public let computerName: String?

        public init(computerAttributes: [Attribute]? = nil, computerId: String? = nil, computerName: String? = nil) {
            self.computerAttributes = computerAttributes
            self.computerId = computerId
            self.computerName = computerName
        }

        private enum CodingKeys: String, CodingKey {
            case computerAttributes = "ComputerAttributes"
            case computerId = "ComputerId"
            case computerName = "ComputerName"
        }
    }

    public struct ConditionalForwarder: AWSDecodableShape {
        /// The IP addresses of the remote DNS server associated with RemoteDomainName. This is the IP address of the DNS server that your conditional forwarder points to.
        public let dnsIpAddrs: [String]?
        /// The fully qualified domain name (FQDN) of the remote domains pointed to by the conditional forwarder.
        public let remoteDomainName: String?
        /// The replication scope of the conditional forwarder. The only allowed value is Domain, which will replicate the conditional forwarder to all of the domain controllers for your Amazon Web Services directory.
        public let replicationScope: ReplicationScope?

        public init(dnsIpAddrs: [String]? = nil, remoteDomainName: String? = nil, replicationScope: ReplicationScope? = nil) {
            self.dnsIpAddrs = dnsIpAddrs
            self.remoteDomainName = remoteDomainName
            self.replicationScope = replicationScope
        }

        private enum CodingKeys: String, CodingKey {
            case dnsIpAddrs = "DnsIpAddrs"
            case remoteDomainName = "RemoteDomainName"
            case replicationScope = "ReplicationScope"
        }
    }

    public struct ConnectDirectoryRequest: AWSEncodableShape {
        /// A DirectoryConnectSettings object that contains additional information for the operation.
        public let connectSettings: DirectoryConnectSettings
        /// A description for the directory.
        public let description: String?
        /// The fully qualified name of your self-managed directory, such as corp.example.com.
        public let name: String
        /// The password for your self-managed user account.
        public let password: String
        /// The NetBIOS name of your self-managed directory, such as CORP.
        public let shortName: String?
        /// The size of the directory.
        public let size: DirectorySize
        /// The tags to be assigned to AD Connector.
        public let tags: [Tag]?

        public init(connectSettings: DirectoryConnectSettings, description: String? = nil, name: String, password: String, shortName: String? = nil, size: DirectorySize, tags: [Tag]? = nil) {
            self.connectSettings = connectSettings
            self.description = description
            self.name = name
            self.password = password
            self.shortName = shortName
            self.size = size
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.connectSettings.validate(name: "\(name).connectSettings")
            try self.validate(self.description, name: "description", parent: name, max: 128)
            try self.validate(self.description, name: "description", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
            try self.validate(self.name, name: "name", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+$")
            try self.validate(self.password, name: "password", parent: name, max: 128)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.shortName, name: "shortName", parent: name, pattern: "^[^\\\\/:*?\"<>|.]+[^\\\\/:*?\"<>|]*$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case connectSettings = "ConnectSettings"
            case description = "Description"
            case name = "Name"
            case password = "Password"
            case shortName = "ShortName"
            case size = "Size"
            case tags = "Tags"
        }
    }

    public struct ConnectDirectoryResult: AWSDecodableShape {
        /// The identifier of the new directory.
        public let directoryId: String?

        public init(directoryId: String? = nil) {
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct CreateAliasRequest: AWSEncodableShape {
        /// The requested alias. The alias must be unique amongst all aliases in Amazon Web Services. This operation throws an EntityAlreadyExistsException error if the alias already exists.
        public let alias: String
        /// The identifier of the directory for which to create the alias.
        public let directoryId: String

        public init(alias: String, directoryId: String) {
            self.alias = alias
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 62)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "^(?!D-|d-)([\\da-zA-Z]+)([-]*[\\da-zA-Z])*$")
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case directoryId = "DirectoryId"
        }
    }

    public struct CreateAliasResult: AWSDecodableShape {
        /// The alias for the directory.
        public let alias: String?
        /// The identifier of the directory.
        public let directoryId: String?

        public init(alias: String? = nil, directoryId: String? = nil) {
            self.alias = alias
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case directoryId = "DirectoryId"
        }
    }

    public struct CreateComputerRequest: AWSEncodableShape {
        /// An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
        public let computerAttributes: [Attribute]?
        /// The name of the computer account.
        public let computerName: String
        /// The identifier of the directory in which to create the computer account.
        public let directoryId: String
        /// The fully-qualified distinguished name of the organizational unit to place the computer account in.
        public let organizationalUnitDistinguishedName: String?
        /// A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.
        public let password: String

        public init(computerAttributes: [Attribute]? = nil, computerName: String, directoryId: String, organizationalUnitDistinguishedName: String? = nil, password: String) {
            self.computerAttributes = computerAttributes
            self.computerName = computerName
            self.directoryId = directoryId
            self.organizationalUnitDistinguishedName = organizationalUnitDistinguishedName
            self.password = password
        }

        public func validate(name: String) throws {
            try self.computerAttributes?.forEach {
                try $0.validate(name: "\(name).computerAttributes[]")
            }
            try self.validate(self.computerName, name: "computerName", parent: name, max: 15)
            try self.validate(self.computerName, name: "computerName", parent: name, min: 1)
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.organizationalUnitDistinguishedName, name: "organizationalUnitDistinguishedName", parent: name, max: 2000)
            try self.validate(self.organizationalUnitDistinguishedName, name: "organizationalUnitDistinguishedName", parent: name, min: 1)
            try self.validate(self.password, name: "password", parent: name, max: 64)
            try self.validate(self.password, name: "password", parent: name, min: 8)
            try self.validate(self.password, name: "password", parent: name, pattern: "^[\\u0020-\\u00FF]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case computerAttributes = "ComputerAttributes"
            case computerName = "ComputerName"
            case directoryId = "DirectoryId"
            case organizationalUnitDistinguishedName = "OrganizationalUnitDistinguishedName"
            case password = "Password"
        }
    }

    public struct CreateComputerResult: AWSDecodableShape {
        /// A Computer object that represents the computer account.
        public let computer: Computer?

        public init(computer: Computer? = nil) {
            self.computer = computer
        }

        private enum CodingKeys: String, CodingKey {
            case computer = "Computer"
        }
    }

    public struct CreateConditionalForwarderRequest: AWSEncodableShape {
        /// The directory ID of the Amazon Web Services directory for which you are creating the conditional forwarder.
        public let directoryId: String
        /// The IP addresses of the remote DNS server associated with RemoteDomainName.
        public let dnsIpAddrs: [String]
        /// The fully qualified domain name (FQDN) of the remote domain with which you will set up a trust relationship.
        public let remoteDomainName: String

        public init(directoryId: String, dnsIpAddrs: [String], remoteDomainName: String) {
            self.directoryId = directoryId
            self.dnsIpAddrs = dnsIpAddrs
            self.remoteDomainName = remoteDomainName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.dnsIpAddrs.forEach {
                try validate($0, name: "dnsIpAddrs[]", parent: name, pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
            }
            try self.validate(self.remoteDomainName, name: "remoteDomainName", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case dnsIpAddrs = "DnsIpAddrs"
            case remoteDomainName = "RemoteDomainName"
        }
    }

    public struct CreateConditionalForwarderResult: AWSDecodableShape {
        public init() {}
    }

    public struct CreateDirectoryRequest: AWSEncodableShape {
        /// A description for the directory.
        public let description: String?
        /// The fully qualified name for the directory, such as corp.example.com.
        public let name: String
        /// The password for the directory administrator. The directory creation process creates a directory administrator account with the user name Administrator and this password. If you need to change the password for the administrator account, you can use the ResetUserPassword API call. The regex pattern for this string is made up of the following conditions:   Length (?=^.{8,64}$) – Must be between 8 and 64 characters   AND any 3 of the following password complexity rules required by Active Directory:   Numbers and upper case and lowercase (?=.*\d)(?=.*[A-Z])(?=.*[a-z])   Numbers and special characters and lower case (?=.*\d)(?=.*[^A-Za-z0-9\s])(?=.*[a-z])   Special characters and upper case and lower case (?=.*[^A-Za-z0-9\s])(?=.*[A-Z])(?=.*[a-z])   Numbers and upper case and special characters (?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9\s])   For additional information about how Active Directory passwords are enforced, see Password must meet complexity requirements on the Microsoft website.
        public let password: String
        /// The NetBIOS name of the directory, such as CORP.
        public let shortName: String?
        /// The size of the directory.
        public let size: DirectorySize
        /// The tags to be assigned to the Simple AD directory.
        public let tags: [Tag]?
        /// A DirectoryVpcSettings object that contains additional information for the operation.
        public let vpcSettings: DirectoryVpcSettings?

        public init(description: String? = nil, name: String, password: String, shortName: String? = nil, size: DirectorySize, tags: [Tag]? = nil, vpcSettings: DirectoryVpcSettings? = nil) {
            self.description = description
            self.name = name
            self.password = password
            self.shortName = shortName
            self.size = size
            self.tags = tags
            self.vpcSettings = vpcSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 128)
            try self.validate(self.description, name: "description", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
            try self.validate(self.name, name: "name", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+$")
            try self.validate(self.password, name: "password", parent: name, pattern: "^(?=^.{8,64}$)((?=.*\\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[^A-Za-z0-9\\s])(?=.*[a-z])|(?=.*[^A-Za-z0-9\\s])(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9\\s]))^")
            try self.validate(self.shortName, name: "shortName", parent: name, pattern: "^[^\\\\/:*?\"<>|.]+[^\\\\/:*?\"<>|]*$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.vpcSettings?.validate(name: "\(name).vpcSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case password = "Password"
            case shortName = "ShortName"
            case size = "Size"
            case tags = "Tags"
            case vpcSettings = "VpcSettings"
        }
    }

    public struct CreateDirectoryResult: AWSDecodableShape {
        /// The identifier of the directory that was created.
        public let directoryId: String?

        public init(directoryId: String? = nil) {
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct CreateLogSubscriptionRequest: AWSEncodableShape {
        /// Identifier of the directory to which you want to subscribe and receive real-time logs to your specified CloudWatch log group.
        public let directoryId: String
        /// The name of the CloudWatch log group where the real-time domain controller logs are forwarded.
        public let logGroupName: String

        public init(directoryId: String, logGroupName: String) {
            self.directoryId = directoryId
            self.logGroupName = logGroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, max: 512)
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, min: 1)
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, pattern: "^[-._/#A-Za-z0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case logGroupName = "LogGroupName"
        }
    }

    public struct CreateLogSubscriptionResult: AWSDecodableShape {
        public init() {}
    }

    public struct CreateMicrosoftADRequest: AWSEncodableShape {
        /// A description for the directory. This label will appear on the Amazon Web Services console Directory Details page after the directory is created.
        public let description: String?
        /// Managed Microsoft AD is available in two editions: Standard and Enterprise. Enterprise is the default.
        public let edition: DirectoryEdition?
        /// The fully qualified domain name for the Managed Microsoft AD directory, such as corp.example.com. This name will resolve inside your VPC only. It does not need to be publicly resolvable.
        public let name: String
        /// The password for the default administrative user named Admin. If you need to change the password for the administrator account, you can use the ResetUserPassword API call.
        public let password: String
        /// The NetBIOS name for your domain, such as CORP. If you don't specify a NetBIOS name, it will default to the first part of your directory DNS. For example, CORP for the directory DNS corp.example.com.
        public let shortName: String?
        /// The tags to be assigned to the Managed Microsoft AD directory.
        public let tags: [Tag]?
        /// Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation.
        public let vpcSettings: DirectoryVpcSettings

        public init(description: String? = nil, edition: DirectoryEdition? = nil, name: String, password: String, shortName: String? = nil, tags: [Tag]? = nil, vpcSettings: DirectoryVpcSettings) {
            self.description = description
            self.edition = edition
            self.name = name
            self.password = password
            self.shortName = shortName
            self.tags = tags
            self.vpcSettings = vpcSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 128)
            try self.validate(self.description, name: "description", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
            try self.validate(self.name, name: "name", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+$")
            try self.validate(self.password, name: "password", parent: name, pattern: "^(?=^.{8,64}$)((?=.*\\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[^A-Za-z0-9\\s])(?=.*[a-z])|(?=.*[^A-Za-z0-9\\s])(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9\\s]))^")
            try self.validate(self.shortName, name: "shortName", parent: name, pattern: "^[^\\\\/:*?\"<>|.]+[^\\\\/:*?\"<>|]*$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.vpcSettings.validate(name: "\(name).vpcSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case edition = "Edition"
            case name = "Name"
            case password = "Password"
            case shortName = "ShortName"
            case tags = "Tags"
            case vpcSettings = "VpcSettings"
        }
    }

    public struct CreateMicrosoftADResult: AWSDecodableShape {
        /// The identifier of the directory that was created.
        public let directoryId: String?

        public init(directoryId: String? = nil) {
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct CreateSnapshotRequest: AWSEncodableShape {
        /// The identifier of the directory of which to take a snapshot.
        public let directoryId: String
        /// The descriptive name to apply to the snapshot.
        public let name: String?

        public init(directoryId: String, name: String? = nil) {
            self.directoryId = directoryId
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case name = "Name"
        }
    }

    public struct CreateSnapshotResult: AWSDecodableShape {
        /// The identifier of the snapshot that was created.
        public let snapshotId: String?

        public init(snapshotId: String? = nil) {
            self.snapshotId = snapshotId
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotId = "SnapshotId"
        }
    }

    public struct CreateTrustRequest: AWSEncodableShape {
        /// The IP addresses of the remote DNS server associated with RemoteDomainName.
        public let conditionalForwarderIpAddrs: [String]?
        /// The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
        public let directoryId: String
        /// The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
        public let remoteDomainName: String
        /// Optional parameter to enable selective authentication for the trust.
        public let selectiveAuth: SelectiveAuth?
        /// The direction of the trust relationship.
        public let trustDirection: TrustDirection
        /// The trust password. The must be the same password that was used when creating the trust relationship on the external domain.
        public let trustPassword: String
        /// The trust relationship type. Forest is the default.
        public let trustType: TrustType?

        public init(conditionalForwarderIpAddrs: [String]? = nil, directoryId: String, remoteDomainName: String, selectiveAuth: SelectiveAuth? = nil, trustDirection: TrustDirection, trustPassword: String, trustType: TrustType? = nil) {
            self.conditionalForwarderIpAddrs = conditionalForwarderIpAddrs
            self.directoryId = directoryId
            self.remoteDomainName = remoteDomainName
            self.selectiveAuth = selectiveAuth
            self.trustDirection = trustDirection
            self.trustPassword = trustPassword
            self.trustType = trustType
        }

        public func validate(name: String) throws {
            try self.conditionalForwarderIpAddrs?.forEach {
                try validate($0, name: "conditionalForwarderIpAddrs[]", parent: name, pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
            }
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.remoteDomainName, name: "remoteDomainName", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$")
            try self.validate(self.trustPassword, name: "trustPassword", parent: name, max: 128)
            try self.validate(self.trustPassword, name: "trustPassword", parent: name, min: 1)
            try self.validate(self.trustPassword, name: "trustPassword", parent: name, pattern: "^(\\p{LD}|\\p{Punct}| )+$")
        }

        private enum CodingKeys: String, CodingKey {
            case conditionalForwarderIpAddrs = "ConditionalForwarderIpAddrs"
            case directoryId = "DirectoryId"
            case remoteDomainName = "RemoteDomainName"
            case selectiveAuth = "SelectiveAuth"
            case trustDirection = "TrustDirection"
            case trustPassword = "TrustPassword"
            case trustType = "TrustType"
        }
    }

    public struct CreateTrustResult: AWSDecodableShape {
        /// A unique identifier for the trust relationship that was created.
        public let trustId: String?

        public init(trustId: String? = nil) {
            self.trustId = trustId
        }

        private enum CodingKeys: String, CodingKey {
            case trustId = "TrustId"
        }
    }

    public struct DeleteConditionalForwarderRequest: AWSEncodableShape {
        /// The directory ID for which you are deleting the conditional forwarder.
        public let directoryId: String
        /// The fully qualified domain name (FQDN) of the remote domain with which you are deleting the conditional forwarder.
        public let remoteDomainName: String

        public init(directoryId: String, remoteDomainName: String) {
            self.directoryId = directoryId
            self.remoteDomainName = remoteDomainName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.remoteDomainName, name: "remoteDomainName", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case remoteDomainName = "RemoteDomainName"
        }
    }

    public struct DeleteConditionalForwarderResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteDirectoryRequest: AWSEncodableShape {
        /// The identifier of the directory to delete.
        public let directoryId: String

        public init(directoryId: String) {
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct DeleteDirectoryResult: AWSDecodableShape {
        /// The directory identifier.
        public let directoryId: String?

        public init(directoryId: String? = nil) {
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct DeleteLogSubscriptionRequest: AWSEncodableShape {
        /// Identifier of the directory whose log subscription you want to delete.
        public let directoryId: String

        public init(directoryId: String) {
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct DeleteLogSubscriptionResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteSnapshotRequest: AWSEncodableShape {
        /// The identifier of the directory snapshot to be deleted.
        public let snapshotId: String

        public init(snapshotId: String) {
            self.snapshotId = snapshotId
        }

        public func validate(name: String) throws {
            try self.validate(self.snapshotId, name: "snapshotId", parent: name, pattern: "^s-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotId = "SnapshotId"
        }
    }

    public struct DeleteSnapshotResult: AWSDecodableShape {
        /// The identifier of the directory snapshot that was deleted.
        public let snapshotId: String?

        public init(snapshotId: String? = nil) {
            self.snapshotId = snapshotId
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotId = "SnapshotId"
        }
    }

    public struct DeleteTrustRequest: AWSEncodableShape {
        /// Delete a conditional forwarder as part of a DeleteTrustRequest.
        public let deleteAssociatedConditionalForwarder: Bool?
        /// The Trust ID of the trust relationship to be deleted.
        public let trustId: String

        public init(deleteAssociatedConditionalForwarder: Bool? = nil, trustId: String) {
            self.deleteAssociatedConditionalForwarder = deleteAssociatedConditionalForwarder
            self.trustId = trustId
        }

        public func validate(name: String) throws {
            try self.validate(self.trustId, name: "trustId", parent: name, pattern: "^t-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case deleteAssociatedConditionalForwarder = "DeleteAssociatedConditionalForwarder"
            case trustId = "TrustId"
        }
    }

    public struct DeleteTrustResult: AWSDecodableShape {
        /// The Trust ID of the trust relationship that was deleted.
        public let trustId: String?

        public init(trustId: String? = nil) {
            self.trustId = trustId
        }

        private enum CodingKeys: String, CodingKey {
            case trustId = "TrustId"
        }
    }

    public struct DeregisterCertificateRequest: AWSEncodableShape {
        /// The identifier of the certificate.
        public let certificateId: String
        /// The identifier of the directory.
        public let directoryId: String

        public init(certificateId: String, directoryId: String) {
            self.certificateId = certificateId
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.certificateId, name: "certificateId", parent: name, pattern: "^c-[0-9a-f]{10}$")
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateId = "CertificateId"
            case directoryId = "DirectoryId"
        }
    }

    public struct DeregisterCertificateResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeregisterEventTopicRequest: AWSEncodableShape {
        /// The Directory ID to remove as a publisher. This directory will no longer send messages to the specified Amazon SNS topic.
        public let directoryId: String
        /// The name of the Amazon SNS topic from which to remove the directory as a publisher.
        public let topicName: String

        public init(directoryId: String, topicName: String) {
            self.directoryId = directoryId
            self.topicName = topicName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.topicName, name: "topicName", parent: name, max: 256)
            try self.validate(self.topicName, name: "topicName", parent: name, min: 1)
            try self.validate(self.topicName, name: "topicName", parent: name, pattern: "^[a-zA-Z0-9_-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case topicName = "TopicName"
        }
    }

    public struct DeregisterEventTopicResult: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeCertificateRequest: AWSEncodableShape {
        /// The identifier of the certificate.
        public let certificateId: String
        /// The identifier of the directory.
        public let directoryId: String

        public init(certificateId: String, directoryId: String) {
            self.certificateId = certificateId
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.certificateId, name: "certificateId", parent: name, pattern: "^c-[0-9a-f]{10}$")
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateId = "CertificateId"
            case directoryId = "DirectoryId"
        }
    }

    public struct DescribeCertificateResult: AWSDecodableShape {
        /// Information about the certificate, including registered date time, certificate state, the reason for the state, expiration date time, and certificate common name.
        public let certificate: Certificate?

        public init(certificate: Certificate? = nil) {
            self.certificate = certificate
        }

        private enum CodingKeys: String, CodingKey {
            case certificate = "Certificate"
        }
    }

    public struct DescribeClientAuthenticationSettingsRequest: AWSEncodableShape {
        /// The identifier of the directory for which to retrieve information.
        public let directoryId: String
        /// The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.
        public let limit: Int?
        /// The DescribeClientAuthenticationSettingsResult.NextToken value from a previous call to DescribeClientAuthenticationSettings. Pass null if this is the first call.
        public let nextToken: String?
        /// The type of client authentication for which to retrieve information. If no type is specified, a list of all client authentication types that are supported for the specified directory is retrieved.
        public let type: ClientAuthenticationType?

        public init(directoryId: String, limit: Int? = nil, nextToken: String? = nil, type: ClientAuthenticationType? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, max: 50)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
            case type = "Type"
        }
    }

    public struct DescribeClientAuthenticationSettingsResult: AWSDecodableShape {
        /// Information about the type of client authentication for the specified directory. The following information is retrieved: The date and time when the status of the client authentication type was last updated, whether the client authentication type is enabled or disabled, and the type of client authentication.
        public let clientAuthenticationSettingsInfo: [ClientAuthenticationSettingInfo]?
        /// The next token used to retrieve the client authentication settings if the number of setting types exceeds page limit and there is another page.
        public let nextToken: String?

        public init(clientAuthenticationSettingsInfo: [ClientAuthenticationSettingInfo]? = nil, nextToken: String? = nil) {
            self.clientAuthenticationSettingsInfo = clientAuthenticationSettingsInfo
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case clientAuthenticationSettingsInfo = "ClientAuthenticationSettingsInfo"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeConditionalForwardersRequest: AWSEncodableShape {
        /// The directory ID for which to get the list of associated conditional forwarders.
        public let directoryId: String
        /// The fully qualified domain names (FQDN) of the remote domains for which to get the list of associated conditional forwarders. If this member is null, all conditional forwarders are returned.
        public let remoteDomainNames: [String]?

        public init(directoryId: String, remoteDomainNames: [String]? = nil) {
            self.directoryId = directoryId
            self.remoteDomainNames = remoteDomainNames
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.remoteDomainNames?.forEach {
                try validate($0, name: "remoteDomainNames[]", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case remoteDomainNames = "RemoteDomainNames"
        }
    }

    public struct DescribeConditionalForwardersResult: AWSDecodableShape {
        /// The list of conditional forwarders that have been created.
        public let conditionalForwarders: [ConditionalForwarder]?

        public init(conditionalForwarders: [ConditionalForwarder]? = nil) {
            self.conditionalForwarders = conditionalForwarders
        }

        private enum CodingKeys: String, CodingKey {
            case conditionalForwarders = "ConditionalForwarders"
        }
    }

    public struct DescribeDirectoriesRequest: AWSEncodableShape {
        /// A list of identifiers of the directories for which to obtain the information. If this member is null, all directories that belong to the current account are returned. An empty list results in an InvalidParameterException being thrown.
        public let directoryIds: [String]?
        /// The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.
        public let limit: Int?
        /// The DescribeDirectoriesResult.NextToken value from a previous call to DescribeDirectories. Pass null if this is the first call.
        public let nextToken: String?

        public init(directoryIds: [String]? = nil, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryIds = directoryIds
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.directoryIds?.forEach {
                try validate($0, name: "directoryIds[]", parent: name, pattern: "^d-[0-9a-f]{10}$")
            }
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryIds = "DirectoryIds"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeDirectoriesResult: AWSDecodableShape {
        /// The list of DirectoryDescription objects that were retrieved. It is possible that this list contains less than the number of items specified in the Limit member of the request. This occurs if there are less than the requested number of items left to retrieve, or if the limitations of the operation have been exceeded.
        public let directoryDescriptions: [DirectoryDescription]?
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeDirectories to retrieve the next set of items.
        public let nextToken: String?

        public init(directoryDescriptions: [DirectoryDescription]? = nil, nextToken: String? = nil) {
            self.directoryDescriptions = directoryDescriptions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case directoryDescriptions = "DirectoryDescriptions"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeDomainControllersRequest: AWSEncodableShape {
        /// Identifier of the directory for which to retrieve the domain controller information.
        public let directoryId: String
        /// A list of identifiers for the domain controllers whose information will be provided.
        public let domainControllerIds: [String]?
        /// The maximum number of items to return.
        public let limit: Int?
        /// The DescribeDomainControllers.NextToken value from a previous call to DescribeDomainControllers. Pass null if this is the first call.
        public let nextToken: String?

        public init(directoryId: String, domainControllerIds: [String]? = nil, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryId = directoryId
            self.domainControllerIds = domainControllerIds
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.domainControllerIds?.forEach {
                try validate($0, name: "domainControllerIds[]", parent: name, pattern: "^dc-[0-9a-f]{10}$")
            }
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case domainControllerIds = "DomainControllerIds"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeDomainControllersResult: AWSDecodableShape {
        /// List of the DomainController objects that were retrieved.
        public let domainControllers: [DomainController]?
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeDomainControllers retrieve the next set of items.
        public let nextToken: String?

        public init(domainControllers: [DomainController]? = nil, nextToken: String? = nil) {
            self.domainControllers = domainControllers
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case domainControllers = "DomainControllers"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeEventTopicsRequest: AWSEncodableShape {
        /// The Directory ID for which to get the list of associated Amazon SNS topics. If this member is null, associations for all Directory IDs are returned.
        public let directoryId: String?
        /// A list of Amazon SNS topic names for which to obtain the information. If this member is null, all associations for the specified Directory ID are returned. An empty list results in an InvalidParameterException being thrown.
        public let topicNames: [String]?

        public init(directoryId: String? = nil, topicNames: [String]? = nil) {
            self.directoryId = directoryId
            self.topicNames = topicNames
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.topicNames?.forEach {
                try validate($0, name: "topicNames[]", parent: name, max: 256)
                try validate($0, name: "topicNames[]", parent: name, min: 1)
                try validate($0, name: "topicNames[]", parent: name, pattern: "^[a-zA-Z0-9_-]+$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case topicNames = "TopicNames"
        }
    }

    public struct DescribeEventTopicsResult: AWSDecodableShape {
        /// A list of Amazon SNS topic names that receive status messages from the specified Directory ID.
        public let eventTopics: [EventTopic]?

        public init(eventTopics: [EventTopic]? = nil) {
            self.eventTopics = eventTopics
        }

        private enum CodingKeys: String, CodingKey {
            case eventTopics = "EventTopics"
        }
    }

    public struct DescribeLDAPSSettingsRequest: AWSEncodableShape {
        /// The identifier of the directory.
        public let directoryId: String
        /// Specifies the number of items that should be displayed on one page.
        public let limit: Int?
        /// The type of next token used for pagination.
        public let nextToken: String?
        /// The type of LDAP security to enable. Currently only the value Client is supported.
        public let type: LDAPSType?

        public init(directoryId: String, limit: Int? = nil, nextToken: String? = nil, type: LDAPSType? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, max: 50)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
            case type = "Type"
        }
    }

    public struct DescribeLDAPSSettingsResult: AWSDecodableShape {
        /// Information about LDAP security for the specified directory, including status of enablement, state last updated date time, and the reason for the state.
        public let ldapsSettingsInfo: [LDAPSSettingInfo]?
        /// The next token used to retrieve the LDAPS settings if the number of setting types exceeds page limit and there is another page.
        public let nextToken: String?

        public init(ldapsSettingsInfo: [LDAPSSettingInfo]? = nil, nextToken: String? = nil) {
            self.ldapsSettingsInfo = ldapsSettingsInfo
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case ldapsSettingsInfo = "LDAPSSettingsInfo"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeRegionsRequest: AWSEncodableShape {
        /// The identifier of the directory.
        public let directoryId: String
        /// The DescribeRegionsResult.NextToken value from a previous call to DescribeRegions. Pass null if this is the first call.
        public let nextToken: String?
        /// The name of the Region. For example, us-east-1.
        public let regionName: String?

        public init(directoryId: String, nextToken: String? = nil, regionName: String? = nil) {
            self.directoryId = directoryId
            self.nextToken = nextToken
            self.regionName = regionName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.regionName, name: "regionName", parent: name, max: 32)
            try self.validate(self.regionName, name: "regionName", parent: name, min: 8)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case nextToken = "NextToken"
            case regionName = "RegionName"
        }
    }

    public struct DescribeRegionsResult: AWSDecodableShape {
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeRegions to retrieve the next set of items.
        public let nextToken: String?
        /// List of Region information related to the directory for each replicated Region.
        public let regionsDescription: [RegionDescription]?

        public init(nextToken: String? = nil, regionsDescription: [RegionDescription]? = nil) {
            self.nextToken = nextToken
            self.regionsDescription = regionsDescription
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case regionsDescription = "RegionsDescription"
        }
    }

    public struct DescribeSettingsRequest: AWSEncodableShape {
        /// The identifier of the directory for which to retrieve information.
        public let directoryId: String
        /// The DescribeSettingsResult.NextToken value from a previous call to DescribeSettings. Pass null if this is the first call.
        public let nextToken: String?
        /// The status of the directory settings for which to retrieve information.
        public let status: DirectoryConfigurationStatus?

        public init(directoryId: String, nextToken: String? = nil, status: DirectoryConfigurationStatus? = nil) {
            self.directoryId = directoryId
            self.nextToken = nextToken
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case nextToken = "NextToken"
            case status = "Status"
        }
    }

    public struct DescribeSettingsResult: AWSDecodableShape {
        /// The identifier of the directory.
        public let directoryId: String?
        /// If not null, token that indicates that more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeSettings to retrieve the next set of items.
        public let nextToken: String?
        /// The list of SettingEntry objects that were retrieved. It is possible that this list contains less than the number of items specified in the Limit member of the request. This occurs if there are less than the requested number of items left to retrieve, or if the limitations of the operation have been exceeded.
        public let settingEntries: [SettingEntry]?

        public init(directoryId: String? = nil, nextToken: String? = nil, settingEntries: [SettingEntry]? = nil) {
            self.directoryId = directoryId
            self.nextToken = nextToken
            self.settingEntries = settingEntries
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case nextToken = "NextToken"
            case settingEntries = "SettingEntries"
        }
    }

    public struct DescribeSharedDirectoriesRequest: AWSEncodableShape {
        /// The number of shared directories to return in the response object.
        public let limit: Int?
        /// The DescribeSharedDirectoriesResult.NextToken value from a previous call to DescribeSharedDirectories. Pass null if this is the first call.
        public let nextToken: String?
        /// Returns the identifier of the directory in the directory owner account.
        public let ownerDirectoryId: String
        /// A list of identifiers of all shared directories in your account.
        public let sharedDirectoryIds: [String]?

        public init(limit: Int? = nil, nextToken: String? = nil, ownerDirectoryId: String, sharedDirectoryIds: [String]? = nil) {
            self.limit = limit
            self.nextToken = nextToken
            self.ownerDirectoryId = ownerDirectoryId
            self.sharedDirectoryIds = sharedDirectoryIds
        }

        public func validate(name: String) throws {
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
            try self.validate(self.ownerDirectoryId, name: "ownerDirectoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.sharedDirectoryIds?.forEach {
                try validate($0, name: "sharedDirectoryIds[]", parent: name, pattern: "^d-[0-9a-f]{10}$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case limit = "Limit"
            case nextToken = "NextToken"
            case ownerDirectoryId = "OwnerDirectoryId"
            case sharedDirectoryIds = "SharedDirectoryIds"
        }
    }

    public struct DescribeSharedDirectoriesResult: AWSDecodableShape {
        /// If not null, token that indicates that more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeSharedDirectories to retrieve the next set of items.
        public let nextToken: String?
        /// A list of all shared directories in your account.
        public let sharedDirectories: [SharedDirectory]?

        public init(nextToken: String? = nil, sharedDirectories: [SharedDirectory]? = nil) {
            self.nextToken = nextToken
            self.sharedDirectories = sharedDirectories
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case sharedDirectories = "SharedDirectories"
        }
    }

    public struct DescribeSnapshotsRequest: AWSEncodableShape {
        /// The identifier of the directory for which to retrieve snapshot information.
        public let directoryId: String?
        /// The maximum number of objects to return.
        public let limit: Int?
        /// The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.
        public let nextToken: String?
        /// A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.
        public let snapshotIds: [String]?

        public init(directoryId: String? = nil, limit: Int? = nil, nextToken: String? = nil, snapshotIds: [String]? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
            self.snapshotIds = snapshotIds
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
            try self.snapshotIds?.forEach {
                try validate($0, name: "snapshotIds[]", parent: name, pattern: "^s-[0-9a-f]{10}$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
            case snapshotIds = "SnapshotIds"
        }
    }

    public struct DescribeSnapshotsResult: AWSDecodableShape {
        /// If not null, more results are available. Pass this value in the NextToken member of a subsequent call to DescribeSnapshots.
        public let nextToken: String?
        /// The list of Snapshot objects that were retrieved. It is possible that this list contains less than the number of items specified in the Limit member of the request. This occurs if there are less than the requested number of items left to retrieve, or if the limitations of the operation have been exceeded.
        public let snapshots: [Snapshot]?

        public init(nextToken: String? = nil, snapshots: [Snapshot]? = nil) {
            self.nextToken = nextToken
            self.snapshots = snapshots
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case snapshots = "Snapshots"
        }
    }

    public struct DescribeTrustsRequest: AWSEncodableShape {
        /// The Directory ID of the Amazon Web Services directory that is a part of the requested trust relationship.
        public let directoryId: String?
        /// The maximum number of objects to return.
        public let limit: Int?
        /// The DescribeTrustsResult.NextToken value from a previous call to DescribeTrusts. Pass null if this is the first call.
        public let nextToken: String?
        /// A list of identifiers of the trust relationships for which to obtain the information. If this member is null, all trust relationships that belong to the current account are returned. An empty list results in an InvalidParameterException being thrown.
        public let trustIds: [String]?

        public init(directoryId: String? = nil, limit: Int? = nil, nextToken: String? = nil, trustIds: [String]? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
            self.trustIds = trustIds
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
            try self.trustIds?.forEach {
                try validate($0, name: "trustIds[]", parent: name, pattern: "^t-[0-9a-f]{10}$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
            case trustIds = "TrustIds"
        }
    }

    public struct DescribeTrustsResult: AWSDecodableShape {
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeTrusts to retrieve the next set of items.
        public let nextToken: String?
        /// The list of Trust objects that were retrieved. It is possible that this list contains less than the number of items specified in the Limit member of the request. This occurs if there are less than the requested number of items left to retrieve, or if the limitations of the operation have been exceeded.
        public let trusts: [Trust]?

        public init(nextToken: String? = nil, trusts: [Trust]? = nil) {
            self.nextToken = nextToken
            self.trusts = trusts
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case trusts = "Trusts"
        }
    }

    public struct DescribeUpdateDirectoryRequest: AWSEncodableShape {
        ///  The unique identifier of the directory.
        public let directoryId: String
        ///  The DescribeUpdateDirectoryResult. NextToken value from a previous call to DescribeUpdateDirectory. Pass null if this is the first call.
        public let nextToken: String?
        ///  The name of the Region.
        public let regionName: String?
        ///  The type of updates you want to describe for the directory.
        public let updateType: UpdateType

        public init(directoryId: String, nextToken: String? = nil, regionName: String? = nil, updateType: UpdateType) {
            self.directoryId = directoryId
            self.nextToken = nextToken
            self.regionName = regionName
            self.updateType = updateType
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.regionName, name: "regionName", parent: name, max: 32)
            try self.validate(self.regionName, name: "regionName", parent: name, min: 8)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case nextToken = "NextToken"
            case regionName = "RegionName"
            case updateType = "UpdateType"
        }
    }

    public struct DescribeUpdateDirectoryResult: AWSDecodableShape {
        ///  If not null, more results are available. Pass this value for the NextToken parameter.
        public let nextToken: String?
        ///  The list of update activities on a directory for the requested update type.
        public let updateActivities: [UpdateInfoEntry]?

        public init(nextToken: String? = nil, updateActivities: [UpdateInfoEntry]? = nil) {
            self.nextToken = nextToken
            self.updateActivities = updateActivities
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case updateActivities = "UpdateActivities"
        }
    }

    public struct DirectoryConnectSettings: AWSEncodableShape {
        /// A list of one or more IP addresses of DNS servers or domain controllers in your self-managed directory.
        public let customerDnsIps: [String]
        /// The user name of an account in your self-managed directory that is used to connect to the directory. This account must have the following permissions:   Read users and groups   Create computer objects   Join computers to the domain
        public let customerUserName: String
        /// A list of subnet identifiers in the VPC in which the AD Connector is created.
        public let subnetIds: [String]
        /// The identifier of the VPC in which the AD Connector is created.
        public let vpcId: String

        public init(customerDnsIps: [String], customerUserName: String, subnetIds: [String], vpcId: String) {
            self.customerDnsIps = customerDnsIps
            self.customerUserName = customerUserName
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        public func validate(name: String) throws {
            try self.customerDnsIps.forEach {
                try validate($0, name: "customerDnsIps[]", parent: name, pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
            }
            try self.validate(self.customerUserName, name: "customerUserName", parent: name, min: 1)
            try self.validate(self.customerUserName, name: "customerUserName", parent: name, pattern: "^[a-zA-Z0-9._-]+$")
            try self.subnetIds.forEach {
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^(subnet-[0-9a-f]{8}|subnet-[0-9a-f]{17})$")
            }
            try self.validate(self.vpcId, name: "vpcId", parent: name, pattern: "^(vpc-[0-9a-f]{8}|vpc-[0-9a-f]{17})$")
        }

        private enum CodingKeys: String, CodingKey {
            case customerDnsIps = "CustomerDnsIps"
            case customerUserName = "CustomerUserName"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct DirectoryConnectSettingsDescription: AWSDecodableShape {
        /// A list of the Availability Zones that the directory is in.
        public let availabilityZones: [String]?
        /// The IP addresses of the AD Connector servers.
        public let connectIps: [String]?
        /// The user name of the service account in your self-managed directory.
        public let customerUserName: String?
        /// The security group identifier for the AD Connector directory.
        public let securityGroupId: String?
        /// A list of subnet identifiers in the VPC that the AD Connector is in.
        public let subnetIds: [String]?
        /// The identifier of the VPC that the AD Connector is in.
        public let vpcId: String?

        public init(availabilityZones: [String]? = nil, connectIps: [String]? = nil, customerUserName: String? = nil, securityGroupId: String? = nil, subnetIds: [String]? = nil, vpcId: String? = nil) {
            self.availabilityZones = availabilityZones
            self.connectIps = connectIps
            self.customerUserName = customerUserName
            self.securityGroupId = securityGroupId
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZones = "AvailabilityZones"
            case connectIps = "ConnectIps"
            case customerUserName = "CustomerUserName"
            case securityGroupId = "SecurityGroupId"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct DirectoryDescription: AWSDecodableShape {
        /// The access URL for the directory, such as http://.awsapps.com. If no alias has been created for the directory,  is the directory identifier, such as d-XXXXXXXXXX.
        public let accessUrl: String?
        /// The alias for the directory. If no alias has been created for the directory, the alias is the directory identifier, such as d-XXXXXXXXXX.
        public let alias: String?
        /// A DirectoryConnectSettingsDescription object that contains additional information about an AD Connector directory. This member is only present if the directory is an AD Connector directory.
        public let connectSettings: DirectoryConnectSettingsDescription?
        /// The description for the directory.
        public let description: String?
        /// The desired number of domain controllers in the directory if the directory is Microsoft AD.
        public let desiredNumberOfDomainControllers: Int?
        /// The directory identifier.
        public let directoryId: String?
        /// The IP addresses of the DNS servers for the directory. For a Simple AD or Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft AD directory servers. For an AD Connector directory, these are the IP addresses of the DNS servers or domain controllers in your self-managed directory to which the AD Connector is connected.
        public let dnsIpAddrs: [String]?
        /// The edition associated with this directory.
        public let edition: DirectoryEdition?
        /// Specifies when the directory was created.
        public let launchTime: Date?
        /// The fully qualified name of the directory.
        public let name: String?
        /// The operating system (OS) version of the directory.
        public let osVersion: OSVersion?
        /// Describes the Managed Microsoft AD directory in the directory owner account.
        public let ownerDirectoryDescription: OwnerDirectoryDescription?
        /// A RadiusSettings object that contains information about the RADIUS server configured for this directory.
        public let radiusSettings: RadiusSettings?
        /// The status of the RADIUS MFA server connection.
        public let radiusStatus: RadiusStatus?
        /// Lists the Regions where the directory has replicated.
        public let regionsInfo: RegionsInfo?
        /// The method used when sharing a directory to determine whether the directory should be shared within your Amazon Web Services organization (ORGANIZATIONS) or with any Amazon Web Services account by sending a shared directory request (HANDSHAKE).
        public let shareMethod: ShareMethod?
        /// A directory share request that is sent by the directory owner to the directory consumer. The request includes a typed message to help the directory consumer administrator determine whether to approve or reject the share invitation.
        public let shareNotes: String?
        /// Current directory status of the shared Managed Microsoft AD directory.
        public let shareStatus: ShareStatus?
        /// The short name of the directory.
        public let shortName: String?
        /// The directory size.
        public let size: DirectorySize?
        /// Indicates if single sign-on is enabled for the directory. For more information, see EnableSso and DisableSso.
        public let ssoEnabled: Bool?
        /// The current stage of the directory.
        public let stage: DirectoryStage?
        /// The date and time that the stage was last updated.
        public let stageLastUpdatedDateTime: Date?
        /// Additional information about the directory stage.
        public let stageReason: String?
        /// The directory size.
        public let type: DirectoryType?
        /// A DirectoryVpcSettingsDescription object that contains additional information about a directory. This member is only present if the directory is a Simple AD or Managed Microsoft AD directory.
        public let vpcSettings: DirectoryVpcSettingsDescription?

        public init(accessUrl: String? = nil, alias: String? = nil, connectSettings: DirectoryConnectSettingsDescription? = nil, description: String? = nil, desiredNumberOfDomainControllers: Int? = nil, directoryId: String? = nil, dnsIpAddrs: [String]? = nil, edition: DirectoryEdition? = nil, launchTime: Date? = nil, name: String? = nil, osVersion: OSVersion? = nil, ownerDirectoryDescription: OwnerDirectoryDescription? = nil, radiusSettings: RadiusSettings? = nil, radiusStatus: RadiusStatus? = nil, regionsInfo: RegionsInfo? = nil, shareMethod: ShareMethod? = nil, shareNotes: String? = nil, shareStatus: ShareStatus? = nil, shortName: String? = nil, size: DirectorySize? = nil, ssoEnabled: Bool? = nil, stage: DirectoryStage? = nil, stageLastUpdatedDateTime: Date? = nil, stageReason: String? = nil, type: DirectoryType? = nil, vpcSettings: DirectoryVpcSettingsDescription? = nil) {
            self.accessUrl = accessUrl
            self.alias = alias
            self.connectSettings = connectSettings
            self.description = description
            self.desiredNumberOfDomainControllers = desiredNumberOfDomainControllers
            self.directoryId = directoryId
            self.dnsIpAddrs = dnsIpAddrs
            self.edition = edition
            self.launchTime = launchTime
            self.name = name
            self.osVersion = osVersion
            self.ownerDirectoryDescription = ownerDirectoryDescription
            self.radiusSettings = radiusSettings
            self.radiusStatus = radiusStatus
            self.regionsInfo = regionsInfo
            self.shareMethod = shareMethod
            self.shareNotes = shareNotes
            self.shareStatus = shareStatus
            self.shortName = shortName
            self.size = size
            self.ssoEnabled = ssoEnabled
            self.stage = stage
            self.stageLastUpdatedDateTime = stageLastUpdatedDateTime
            self.stageReason = stageReason
            self.type = type
            self.vpcSettings = vpcSettings
        }

        private enum CodingKeys: String, CodingKey {
            case accessUrl = "AccessUrl"
            case alias = "Alias"
            case connectSettings = "ConnectSettings"
            case description = "Description"
            case desiredNumberOfDomainControllers = "DesiredNumberOfDomainControllers"
            case directoryId = "DirectoryId"
            case dnsIpAddrs = "DnsIpAddrs"
            case edition = "Edition"
            case launchTime = "LaunchTime"
            case name = "Name"
            case osVersion = "OsVersion"
            case ownerDirectoryDescription = "OwnerDirectoryDescription"
            case radiusSettings = "RadiusSettings"
            case radiusStatus = "RadiusStatus"
            case regionsInfo = "RegionsInfo"
            case shareMethod = "ShareMethod"
            case shareNotes = "ShareNotes"
            case shareStatus = "ShareStatus"
            case shortName = "ShortName"
            case size = "Size"
            case ssoEnabled = "SsoEnabled"
            case stage = "Stage"
            case stageLastUpdatedDateTime = "StageLastUpdatedDateTime"
            case stageReason = "StageReason"
            case type = "Type"
            case vpcSettings = "VpcSettings"
        }
    }

    public struct DirectoryLimits: AWSDecodableShape {
        /// The current number of cloud directories in the Region.
        public let cloudOnlyDirectoriesCurrentCount: Int?
        /// The maximum number of cloud directories allowed in the Region.
        public let cloudOnlyDirectoriesLimit: Int?
        /// Indicates if the cloud directory limit has been reached.
        public let cloudOnlyDirectoriesLimitReached: Bool?
        /// The current number of Managed Microsoft AD directories in the region.
        public let cloudOnlyMicrosoftADCurrentCount: Int?
        /// The maximum number of Managed Microsoft AD directories allowed in the region.
        public let cloudOnlyMicrosoftADLimit: Int?
        /// Indicates if the Managed Microsoft AD directory limit has been reached.
        public let cloudOnlyMicrosoftADLimitReached: Bool?
        /// The current number of connected directories in the Region.
        public let connectedDirectoriesCurrentCount: Int?
        /// The maximum number of connected directories allowed in the Region.
        public let connectedDirectoriesLimit: Int?
        /// Indicates if the connected directory limit has been reached.
        public let connectedDirectoriesLimitReached: Bool?

        public init(cloudOnlyDirectoriesCurrentCount: Int? = nil, cloudOnlyDirectoriesLimit: Int? = nil, cloudOnlyDirectoriesLimitReached: Bool? = nil, cloudOnlyMicrosoftADCurrentCount: Int? = nil, cloudOnlyMicrosoftADLimit: Int? = nil, cloudOnlyMicrosoftADLimitReached: Bool? = nil, connectedDirectoriesCurrentCount: Int? = nil, connectedDirectoriesLimit: Int? = nil, connectedDirectoriesLimitReached: Bool? = nil) {
            self.cloudOnlyDirectoriesCurrentCount = cloudOnlyDirectoriesCurrentCount
            self.cloudOnlyDirectoriesLimit = cloudOnlyDirectoriesLimit
            self.cloudOnlyDirectoriesLimitReached = cloudOnlyDirectoriesLimitReached
            self.cloudOnlyMicrosoftADCurrentCount = cloudOnlyMicrosoftADCurrentCount
            self.cloudOnlyMicrosoftADLimit = cloudOnlyMicrosoftADLimit
            self.cloudOnlyMicrosoftADLimitReached = cloudOnlyMicrosoftADLimitReached
            self.connectedDirectoriesCurrentCount = connectedDirectoriesCurrentCount
            self.connectedDirectoriesLimit = connectedDirectoriesLimit
            self.connectedDirectoriesLimitReached = connectedDirectoriesLimitReached
        }

        private enum CodingKeys: String, CodingKey {
            case cloudOnlyDirectoriesCurrentCount = "CloudOnlyDirectoriesCurrentCount"
            case cloudOnlyDirectoriesLimit = "CloudOnlyDirectoriesLimit"
            case cloudOnlyDirectoriesLimitReached = "CloudOnlyDirectoriesLimitReached"
            case cloudOnlyMicrosoftADCurrentCount = "CloudOnlyMicrosoftADCurrentCount"
            case cloudOnlyMicrosoftADLimit = "CloudOnlyMicrosoftADLimit"
            case cloudOnlyMicrosoftADLimitReached = "CloudOnlyMicrosoftADLimitReached"
            case connectedDirectoriesCurrentCount = "ConnectedDirectoriesCurrentCount"
            case connectedDirectoriesLimit = "ConnectedDirectoriesLimit"
            case connectedDirectoriesLimitReached = "ConnectedDirectoriesLimitReached"
        }
    }

    public struct DirectoryVpcSettings: AWSEncodableShape & AWSDecodableShape {
        /// The identifiers of the subnets for the directory servers. The two subnets must be in different Availability Zones. Directory Service creates a directory server and a DNS server in each of these subnets.
        public let subnetIds: [String]
        /// The identifier of the VPC in which to create the directory.
        public let vpcId: String

        public init(subnetIds: [String], vpcId: String) {
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        public func validate(name: String) throws {
            try self.subnetIds.forEach {
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^(subnet-[0-9a-f]{8}|subnet-[0-9a-f]{17})$")
            }
            try self.validate(self.vpcId, name: "vpcId", parent: name, pattern: "^(vpc-[0-9a-f]{8}|vpc-[0-9a-f]{17})$")
        }

        private enum CodingKeys: String, CodingKey {
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct DirectoryVpcSettingsDescription: AWSDecodableShape {
        /// The list of Availability Zones that the directory is in.
        public let availabilityZones: [String]?
        /// The domain controller security group identifier for the directory.
        public let securityGroupId: String?
        /// The identifiers of the subnets for the directory servers.
        public let subnetIds: [String]?
        /// The identifier of the VPC that the directory is in.
        public let vpcId: String?

        public init(availabilityZones: [String]? = nil, securityGroupId: String? = nil, subnetIds: [String]? = nil, vpcId: String? = nil) {
            self.availabilityZones = availabilityZones
            self.securityGroupId = securityGroupId
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZones = "AvailabilityZones"
            case securityGroupId = "SecurityGroupId"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }

    public struct DisableClientAuthenticationRequest: AWSEncodableShape {
        /// The identifier of the directory
        public let directoryId: String
        /// The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.
        public let type: ClientAuthenticationType

        public init(directoryId: String, type: ClientAuthenticationType) {
            self.directoryId = directoryId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case type = "Type"
        }
    }

    public struct DisableClientAuthenticationResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisableLDAPSRequest: AWSEncodableShape {
        /// The identifier of the directory.
        public let directoryId: String
        /// The type of LDAP security to enable. Currently only the value Client is supported.
        public let type: LDAPSType

        public init(directoryId: String, type: LDAPSType) {
            self.directoryId = directoryId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case type = "Type"
        }
    }

    public struct DisableLDAPSResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisableRadiusRequest: AWSEncodableShape {
        /// The identifier of the directory for which to disable MFA.
        public let directoryId: String

        public init(directoryId: String) {
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct DisableRadiusResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisableSsoRequest: AWSEncodableShape {
        /// The identifier of the directory for which to disable single-sign on.
        public let directoryId: String
        /// The password of an alternate account to use to disable single-sign on. This is only used for AD Connector directories. For more information, see the UserName parameter.
        public let password: String?
        /// The username of an alternate account to use to disable single-sign on. This is only used for AD Connector directories. This account must have privileges to remove a service principal name. If the AD Connector service account does not have privileges to remove a service principal name, you can specify an alternate account with the UserName and Password parameters. These credentials are only used to disable single sign-on and are not stored by the service. The AD Connector service account is not changed.
        public let userName: String?

        public init(directoryId: String, password: String? = nil, userName: String? = nil) {
            self.directoryId = directoryId
            self.password = password
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.password, name: "password", parent: name, max: 128)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[a-zA-Z0-9._-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case password = "Password"
            case userName = "UserName"
        }
    }

    public struct DisableSsoResult: AWSDecodableShape {
        public init() {}
    }

    public struct DomainController: AWSDecodableShape {
        /// The Availability Zone where the domain controller is located.
        public let availabilityZone: String?
        /// Identifier of the directory where the domain controller resides.
        public let directoryId: String?
        /// The IP address of the domain controller.
        public let dnsIpAddr: String?
        /// Identifies a specific domain controller in the directory.
        public let domainControllerId: String?
        /// Specifies when the domain controller was created.
        public let launchTime: Date?
        /// The status of the domain controller.
        public let status: DomainControllerStatus?
        /// The date and time that the status was last updated.
        public let statusLastUpdatedDateTime: Date?
        /// A description of the domain controller state.
        public let statusReason: String?
        /// Identifier of the subnet in the VPC that contains the domain controller.
        public let subnetId: String?
        /// The identifier of the VPC that contains the domain controller.
        public let vpcId: String?

        public init(availabilityZone: String? = nil, directoryId: String? = nil, dnsIpAddr: String? = nil, domainControllerId: String? = nil, launchTime: Date? = nil, status: DomainControllerStatus? = nil, statusLastUpdatedDateTime: Date? = nil, statusReason: String? = nil, subnetId: String? = nil, vpcId: String? = nil) {
            self.availabilityZone = availabilityZone
            self.directoryId = directoryId
            self.dnsIpAddr = dnsIpAddr
            self.domainControllerId = domainControllerId
            self.launchTime = launchTime
            self.status = status
            self.statusLastUpdatedDateTime = statusLastUpdatedDateTime
            self.statusReason = statusReason
            self.subnetId = subnetId
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone = "AvailabilityZone"
            case directoryId = "DirectoryId"
            case dnsIpAddr = "DnsIpAddr"
            case domainControllerId = "DomainControllerId"
            case launchTime = "LaunchTime"
            case status = "Status"
            case statusLastUpdatedDateTime = "StatusLastUpdatedDateTime"
            case statusReason = "StatusReason"
            case subnetId = "SubnetId"
            case vpcId = "VpcId"
        }
    }

    public struct EnableClientAuthenticationRequest: AWSEncodableShape {
        /// The identifier of the specified directory.
        public let directoryId: String
        /// The type of client authentication to enable. Currently only the value SmartCard is supported. Smart card authentication in AD Connector requires that you enable Kerberos Constrained Delegation for the Service User to the LDAP service in your self-managed AD.
        public let type: ClientAuthenticationType

        public init(directoryId: String, type: ClientAuthenticationType) {
            self.directoryId = directoryId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case type = "Type"
        }
    }

    public struct EnableClientAuthenticationResult: AWSDecodableShape {
        public init() {}
    }

    public struct EnableLDAPSRequest: AWSEncodableShape {
        /// The identifier of the directory.
        public let directoryId: String
        /// The type of LDAP security to enable. Currently only the value Client is supported.
        public let type: LDAPSType

        public init(directoryId: String, type: LDAPSType) {
            self.directoryId = directoryId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case type = "Type"
        }
    }

    public struct EnableLDAPSResult: AWSDecodableShape {
        public init() {}
    }

    public struct EnableRadiusRequest: AWSEncodableShape {
        /// The identifier of the directory for which to enable MFA.
        public let directoryId: String
        /// A RadiusSettings object that contains information about the RADIUS server.
        public let radiusSettings: RadiusSettings

        public init(directoryId: String, radiusSettings: RadiusSettings) {
            self.directoryId = directoryId
            self.radiusSettings = radiusSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.radiusSettings.validate(name: "\(name).radiusSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case radiusSettings = "RadiusSettings"
        }
    }

    public struct EnableRadiusResult: AWSDecodableShape {
        public init() {}
    }

    public struct EnableSsoRequest: AWSEncodableShape {
        /// The identifier of the directory for which to enable single-sign on.
        public let directoryId: String
        /// The password of an alternate account to use to enable single-sign on. This is only used for AD Connector directories. For more information, see the UserName parameter.
        public let password: String?
        /// The username of an alternate account to use to enable single-sign on. This is only used for AD Connector directories. This account must have privileges to add a service principal name. If the AD Connector service account does not have privileges to add a service principal name, you can specify an alternate account with the UserName and Password parameters. These credentials are only used to enable single sign-on and are not stored by the service. The AD Connector service account is not changed.
        public let userName: String?

        public init(directoryId: String, password: String? = nil, userName: String? = nil) {
            self.directoryId = directoryId
            self.password = password
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.password, name: "password", parent: name, max: 128)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[a-zA-Z0-9._-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case password = "Password"
            case userName = "UserName"
        }
    }

    public struct EnableSsoResult: AWSDecodableShape {
        public init() {}
    }

    public struct EventTopic: AWSDecodableShape {
        /// The date and time of when you associated your directory with the Amazon SNS topic.
        public let createdDateTime: Date?
        /// The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS topic.
        public let directoryId: String?
        /// The topic registration status.
        public let status: TopicStatus?
        /// The Amazon SNS topic ARN (Amazon Resource Name).
        public let topicArn: String?
        /// The name of an Amazon SNS topic the receives status messages from the directory.
        public let topicName: String?

        public init(createdDateTime: Date? = nil, directoryId: String? = nil, status: TopicStatus? = nil, topicArn: String? = nil, topicName: String? = nil) {
            self.createdDateTime = createdDateTime
            self.directoryId = directoryId
            self.status = status
            self.topicArn = topicArn
            self.topicName = topicName
        }

        private enum CodingKeys: String, CodingKey {
            case createdDateTime = "CreatedDateTime"
            case directoryId = "DirectoryId"
            case status = "Status"
            case topicArn = "TopicArn"
            case topicName = "TopicName"
        }
    }

    public struct GetDirectoryLimitsRequest: AWSEncodableShape {
        public init() {}
    }

    public struct GetDirectoryLimitsResult: AWSDecodableShape {
        /// A DirectoryLimits object that contains the directory limits for the current Region.
        public let directoryLimits: DirectoryLimits?

        public init(directoryLimits: DirectoryLimits? = nil) {
            self.directoryLimits = directoryLimits
        }

        private enum CodingKeys: String, CodingKey {
            case directoryLimits = "DirectoryLimits"
        }
    }

    public struct GetSnapshotLimitsRequest: AWSEncodableShape {
        /// Contains the identifier of the directory to obtain the limits for.
        public let directoryId: String

        public init(directoryId: String) {
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct GetSnapshotLimitsResult: AWSDecodableShape {
        /// A SnapshotLimits object that contains the manual snapshot limits for the specified directory.
        public let snapshotLimits: SnapshotLimits?

        public init(snapshotLimits: SnapshotLimits? = nil) {
            self.snapshotLimits = snapshotLimits
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotLimits = "SnapshotLimits"
        }
    }

    public struct IpRoute: AWSEncodableShape {
        /// IP address block using CIDR format, for example 10.0.0.0/24. This is often the address block of the DNS server used for your self-managed domain. For a single IP address use a CIDR address block with /32. For example 10.0.0.0/32.
        public let cidrIp: String?
        /// Description of the address block.
        public let description: String?

        public init(cidrIp: String? = nil, description: String? = nil) {
            self.cidrIp = cidrIp
            self.description = description
        }

        public func validate(name: String) throws {
            try self.validate(self.cidrIp, name: "cidrIp", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([1-9]|[1-2][0-9]|3[0-2]))$")
            try self.validate(self.description, name: "description", parent: name, max: 128)
            try self.validate(self.description, name: "description", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case cidrIp = "CidrIp"
            case description = "Description"
        }
    }

    public struct IpRouteInfo: AWSDecodableShape {
        /// The date and time the address block was added to the directory.
        public let addedDateTime: Date?
        /// IP address block in the IpRoute.
        public let cidrIp: String?
        /// Description of the IpRouteInfo.
        public let description: String?
        /// Identifier (ID) of the directory associated with the IP addresses.
        public let directoryId: String?
        /// The status of the IP address block.
        public let ipRouteStatusMsg: IpRouteStatusMsg?
        /// The reason for the IpRouteStatusMsg.
        public let ipRouteStatusReason: String?

        public init(addedDateTime: Date? = nil, cidrIp: String? = nil, description: String? = nil, directoryId: String? = nil, ipRouteStatusMsg: IpRouteStatusMsg? = nil, ipRouteStatusReason: String? = nil) {
            self.addedDateTime = addedDateTime
            self.cidrIp = cidrIp
            self.description = description
            self.directoryId = directoryId
            self.ipRouteStatusMsg = ipRouteStatusMsg
            self.ipRouteStatusReason = ipRouteStatusReason
        }

        private enum CodingKeys: String, CodingKey {
            case addedDateTime = "AddedDateTime"
            case cidrIp = "CidrIp"
            case description = "Description"
            case directoryId = "DirectoryId"
            case ipRouteStatusMsg = "IpRouteStatusMsg"
            case ipRouteStatusReason = "IpRouteStatusReason"
        }
    }

    public struct LDAPSSettingInfo: AWSDecodableShape {
        /// The date and time when the LDAPS settings were last updated.
        public let lastUpdatedDateTime: Date?
        /// The state of the LDAPS settings.
        public let ldapsStatus: LDAPSStatus?
        /// Describes a state change for LDAPS.
        public let ldapsStatusReason: String?

        public init(lastUpdatedDateTime: Date? = nil, ldapsStatus: LDAPSStatus? = nil, ldapsStatusReason: String? = nil) {
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.ldapsStatus = ldapsStatus
            self.ldapsStatusReason = ldapsStatusReason
        }

        private enum CodingKeys: String, CodingKey {
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case ldapsStatus = "LDAPSStatus"
            case ldapsStatusReason = "LDAPSStatusReason"
        }
    }

    public struct ListCertificatesRequest: AWSEncodableShape {
        /// The identifier of the directory.
        public let directoryId: String
        /// The number of items that should show up on one page
        public let limit: Int?
        /// A token for requesting another page of certificates if the NextToken response element indicates that more certificates are available. Use the value of the returned NextToken element in your request until the token comes back as null. Pass null if this is the first call.
        public let nextToken: String?

        public init(directoryId: String, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, max: 50)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct ListCertificatesResult: AWSDecodableShape {
        /// A list of certificates with basic details including certificate ID, certificate common name, certificate state.
        public let certificatesInfo: [CertificateInfo]?
        /// Indicates whether another page of certificates is available when the number of available certificates exceeds the page limit.
        public let nextToken: String?

        public init(certificatesInfo: [CertificateInfo]? = nil, nextToken: String? = nil) {
            self.certificatesInfo = certificatesInfo
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case certificatesInfo = "CertificatesInfo"
            case nextToken = "NextToken"
        }
    }

    public struct ListIpRoutesRequest: AWSEncodableShape {
        /// Identifier (ID) of the directory for which you want to retrieve the IP addresses.
        public let directoryId: String
        /// Maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.
        public let limit: Int?
        /// The ListIpRoutes.NextToken value from a previous call to ListIpRoutes. Pass null if this is the first call.
        public let nextToken: String?

        public init(directoryId: String, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct ListIpRoutesResult: AWSDecodableShape {
        /// A list of IpRoutes.
        public let ipRoutesInfo: [IpRouteInfo]?
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to ListIpRoutes to retrieve the next set of items.
        public let nextToken: String?

        public init(ipRoutesInfo: [IpRouteInfo]? = nil, nextToken: String? = nil) {
            self.ipRoutesInfo = ipRoutesInfo
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case ipRoutesInfo = "IpRoutesInfo"
            case nextToken = "NextToken"
        }
    }

    public struct ListLogSubscriptionsRequest: AWSEncodableShape {
        /// If a DirectoryID is provided, lists only the log subscription associated with that directory. If no DirectoryId is provided, lists all log subscriptions associated with your Amazon Web Services account. If there are no log subscriptions for the Amazon Web Services account or the directory, an empty list will be returned.
        public let directoryId: String?
        /// The maximum number of items returned.
        public let limit: Int?
        /// The token for the next set of items to return.
        public let nextToken: String?

        public init(directoryId: String? = nil, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct ListLogSubscriptionsResult: AWSDecodableShape {
        /// A list of active LogSubscription objects for calling the Amazon Web Services account.
        public let logSubscriptions: [LogSubscription]?
        /// The token for the next set of items to return.
        public let nextToken: String?

        public init(logSubscriptions: [LogSubscription]? = nil, nextToken: String? = nil) {
            self.logSubscriptions = logSubscriptions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case logSubscriptions = "LogSubscriptions"
            case nextToken = "NextToken"
        }
    }

    public struct ListSchemaExtensionsRequest: AWSEncodableShape {
        /// The identifier of the directory from which to retrieve the schema extension information.
        public let directoryId: String
        /// The maximum number of items to return.
        public let limit: Int?
        /// The ListSchemaExtensions.NextToken value from a previous call to ListSchemaExtensions. Pass null if this is the first call.
        public let nextToken: String?

        public init(directoryId: String, limit: Int? = nil, nextToken: String? = nil) {
            self.directoryId = directoryId
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct ListSchemaExtensionsResult: AWSDecodableShape {
        /// If not null, more results are available. Pass this value for the NextToken parameter in a subsequent call to ListSchemaExtensions to retrieve the next set of items.
        public let nextToken: String?
        /// Information about the schema extensions applied to the directory.
        public let schemaExtensionsInfo: [SchemaExtensionInfo]?

        public init(nextToken: String? = nil, schemaExtensionsInfo: [SchemaExtensionInfo]? = nil) {
            self.nextToken = nextToken
            self.schemaExtensionsInfo = schemaExtensionsInfo
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case schemaExtensionsInfo = "SchemaExtensionsInfo"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// Reserved for future use.
        public let limit: Int?
        /// Reserved for future use.
        public let nextToken: String?
        /// Identifier (ID) of the directory for which you want to retrieve tags.
        public let resourceId: String

        public init(limit: Int? = nil, nextToken: String? = nil, resourceId: String) {
            self.limit = limit
            self.nextToken = nextToken
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.limit, name: "limit", parent: name, min: 0)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^[d]-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case limit = "Limit"
            case nextToken = "NextToken"
            case resourceId = "ResourceId"
        }
    }

    public struct ListTagsForResourceResult: AWSDecodableShape {
        /// Reserved for future use.
        public let nextToken: String?
        /// List of tags returned by the ListTagsForResource operation.
        public let tags: [Tag]?

        public init(nextToken: String? = nil, tags: [Tag]? = nil) {
            self.nextToken = nextToken
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tags = "Tags"
        }
    }

    public struct LogSubscription: AWSDecodableShape {
        /// Identifier (ID) of the directory that you want to associate with the log subscription.
        public let directoryId: String?
        /// The name of the log group.
        public let logGroupName: String?
        /// The date and time that the log subscription was created.
        public let subscriptionCreatedDateTime: Date?

        public init(directoryId: String? = nil, logGroupName: String? = nil, subscriptionCreatedDateTime: Date? = nil) {
            self.directoryId = directoryId
            self.logGroupName = logGroupName
            self.subscriptionCreatedDateTime = subscriptionCreatedDateTime
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case logGroupName = "LogGroupName"
            case subscriptionCreatedDateTime = "SubscriptionCreatedDateTime"
        }
    }

    public struct OSUpdateSettings: AWSEncodableShape & AWSDecodableShape {
        ///  OS version that the directory needs to be updated to.
        public let osVersion: OSVersion?

        public init(osVersion: OSVersion? = nil) {
            self.osVersion = osVersion
        }

        private enum CodingKeys: String, CodingKey {
            case osVersion = "OSVersion"
        }
    }

    public struct OwnerDirectoryDescription: AWSDecodableShape {
        /// Identifier of the directory owner account.
        public let accountId: String?
        /// Identifier of the Managed Microsoft AD directory in the directory owner account.
        public let directoryId: String?
        /// IP address of the directory’s domain controllers.
        public let dnsIpAddrs: [String]?
        /// A RadiusSettings object that contains information about the RADIUS server.
        public let radiusSettings: RadiusSettings?
        /// Information about the status of the RADIUS server.
        public let radiusStatus: RadiusStatus?
        /// Information about the VPC settings for the directory.
        public let vpcSettings: DirectoryVpcSettingsDescription?

        public init(accountId: String? = nil, directoryId: String? = nil, dnsIpAddrs: [String]? = nil, radiusSettings: RadiusSettings? = nil, radiusStatus: RadiusStatus? = nil, vpcSettings: DirectoryVpcSettingsDescription? = nil) {
            self.accountId = accountId
            self.directoryId = directoryId
            self.dnsIpAddrs = dnsIpAddrs
            self.radiusSettings = radiusSettings
            self.radiusStatus = radiusStatus
            self.vpcSettings = vpcSettings
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case directoryId = "DirectoryId"
            case dnsIpAddrs = "DnsIpAddrs"
            case radiusSettings = "RadiusSettings"
            case radiusStatus = "RadiusStatus"
            case vpcSettings = "VpcSettings"
        }
    }

    public struct RadiusSettings: AWSEncodableShape & AWSDecodableShape {
        /// The protocol specified for your RADIUS endpoints.
        public let authenticationProtocol: RadiusAuthenticationProtocol?
        /// Not currently used.
        public let displayLabel: String?
        /// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the Directory Service servers.
        public let radiusPort: Int?
        /// The maximum number of times that communication with the RADIUS server is attempted.
        public let radiusRetries: Int?
        /// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
        public let radiusServers: [String]?
        /// The amount of time, in seconds, to wait for the RADIUS server to respond.
        public let radiusTimeout: Int?
        /// Required for enabling RADIUS on the directory.
        public let sharedSecret: String?
        /// Not currently used.
        public let useSameUsername: Bool?

        public init(authenticationProtocol: RadiusAuthenticationProtocol? = nil, displayLabel: String? = nil, radiusPort: Int? = nil, radiusRetries: Int? = nil, radiusServers: [String]? = nil, radiusTimeout: Int? = nil, sharedSecret: String? = nil, useSameUsername: Bool? = nil) {
            self.authenticationProtocol = authenticationProtocol
            self.displayLabel = displayLabel
            self.radiusPort = radiusPort
            self.radiusRetries = radiusRetries
            self.radiusServers = radiusServers
            self.radiusTimeout = radiusTimeout
            self.sharedSecret = sharedSecret
            self.useSameUsername = useSameUsername
        }

        public func validate(name: String) throws {
            try self.validate(self.displayLabel, name: "displayLabel", parent: name, max: 64)
            try self.validate(self.displayLabel, name: "displayLabel", parent: name, min: 1)
            try self.validate(self.radiusPort, name: "radiusPort", parent: name, max: 65535)
            try self.validate(self.radiusPort, name: "radiusPort", parent: name, min: 1025)
            try self.validate(self.radiusRetries, name: "radiusRetries", parent: name, max: 10)
            try self.validate(self.radiusRetries, name: "radiusRetries", parent: name, min: 0)
            try self.radiusServers?.forEach {
                try validate($0, name: "radiusServers[]", parent: name, max: 256)
                try validate($0, name: "radiusServers[]", parent: name, min: 1)
            }
            try self.validate(self.radiusTimeout, name: "radiusTimeout", parent: name, max: 20)
            try self.validate(self.radiusTimeout, name: "radiusTimeout", parent: name, min: 1)
            try self.validate(self.sharedSecret, name: "sharedSecret", parent: name, max: 512)
            try self.validate(self.sharedSecret, name: "sharedSecret", parent: name, min: 8)
            try self.validate(self.sharedSecret, name: "sharedSecret", parent: name, pattern: "^(\\p{LD}|\\p{Punct}| )+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationProtocol = "AuthenticationProtocol"
            case displayLabel = "DisplayLabel"
            case radiusPort = "RadiusPort"
            case radiusRetries = "RadiusRetries"
            case radiusServers = "RadiusServers"
            case radiusTimeout = "RadiusTimeout"
            case sharedSecret = "SharedSecret"
            case useSameUsername = "UseSameUsername"
        }
    }

    public struct RegionDescription: AWSDecodableShape {
        /// The desired number of domain controllers in the specified Region for the specified directory.
        public let desiredNumberOfDomainControllers: Int?
        /// The identifier of the directory.
        public let directoryId: String?
        /// The date and time that the Region description was last updated.
        public let lastUpdatedDateTime: Date?
        /// Specifies when the Region replication began.
        public let launchTime: Date?
        /// The name of the Region. For example, us-east-1.
        public let regionName: String?
        /// Specifies whether the Region is the primary Region or an additional Region.
        public let regionType: RegionType?
        /// The status of the replication process for the specified Region.
        public let status: DirectoryStage?
        /// The date and time that the Region status was last updated.
        public let statusLastUpdatedDateTime: Date?
        public let vpcSettings: DirectoryVpcSettings?

        public init(desiredNumberOfDomainControllers: Int? = nil, directoryId: String? = nil, lastUpdatedDateTime: Date? = nil, launchTime: Date? = nil, regionName: String? = nil, regionType: RegionType? = nil, status: DirectoryStage? = nil, statusLastUpdatedDateTime: Date? = nil, vpcSettings: DirectoryVpcSettings? = nil) {
            self.desiredNumberOfDomainControllers = desiredNumberOfDomainControllers
            self.directoryId = directoryId
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.launchTime = launchTime
            self.regionName = regionName
            self.regionType = regionType
            self.status = status
            self.statusLastUpdatedDateTime = statusLastUpdatedDateTime
            self.vpcSettings = vpcSettings
        }

        private enum CodingKeys: String, CodingKey {
            case desiredNumberOfDomainControllers = "DesiredNumberOfDomainControllers"
            case directoryId = "DirectoryId"
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case launchTime = "LaunchTime"
            case regionName = "RegionName"
            case regionType = "RegionType"
            case status = "Status"
            case statusLastUpdatedDateTime = "StatusLastUpdatedDateTime"
            case vpcSettings = "VpcSettings"
        }
    }

    public struct RegionsInfo: AWSDecodableShape {
        /// Lists the Regions where the directory has been replicated, excluding the primary Region.
        public let additionalRegions: [String]?
        /// The Region where the Managed Microsoft AD directory was originally created.
        public let primaryRegion: String?

        public init(additionalRegions: [String]? = nil, primaryRegion: String? = nil) {
            self.additionalRegions = additionalRegions
            self.primaryRegion = primaryRegion
        }

        private enum CodingKeys: String, CodingKey {
            case additionalRegions = "AdditionalRegions"
            case primaryRegion = "PrimaryRegion"
        }
    }

    public struct RegisterCertificateRequest: AWSEncodableShape {
        /// The certificate PEM string that needs to be registered.
        public let certificateData: String
        /// A ClientCertAuthSettings object that contains client certificate authentication settings.
        public let clientCertAuthSettings: ClientCertAuthSettings?
        /// The identifier of the directory.
        public let directoryId: String
        /// The function that the registered certificate performs. Valid values include ClientLDAPS or ClientCertAuth. The default value is ClientLDAPS.
        public let type: CertificateType?

        public init(certificateData: String, clientCertAuthSettings: ClientCertAuthSettings? = nil, directoryId: String, type: CertificateType? = nil) {
            self.certificateData = certificateData
            self.clientCertAuthSettings = clientCertAuthSettings
            self.directoryId = directoryId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.certificateData, name: "certificateData", parent: name, max: 8192)
            try self.validate(self.certificateData, name: "certificateData", parent: name, min: 1)
            try self.clientCertAuthSettings?.validate(name: "\(name).clientCertAuthSettings")
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateData = "CertificateData"
            case clientCertAuthSettings = "ClientCertAuthSettings"
            case directoryId = "DirectoryId"
            case type = "Type"
        }
    }

    public struct RegisterCertificateResult: AWSDecodableShape {
        /// The identifier of the certificate.
        public let certificateId: String?

        public init(certificateId: String? = nil) {
            self.certificateId = certificateId
        }

        private enum CodingKeys: String, CodingKey {
            case certificateId = "CertificateId"
        }
    }

    public struct RegisterEventTopicRequest: AWSEncodableShape {
        /// The Directory ID that will publish status messages to the Amazon SNS topic.
        public let directoryId: String
        /// The Amazon SNS topic name to which the directory will publish status messages. This Amazon SNS topic must be in the same region as the specified Directory ID.
        public let topicName: String

        public init(directoryId: String, topicName: String) {
            self.directoryId = directoryId
            self.topicName = topicName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.topicName, name: "topicName", parent: name, max: 256)
            try self.validate(self.topicName, name: "topicName", parent: name, min: 1)
            try self.validate(self.topicName, name: "topicName", parent: name, pattern: "^[a-zA-Z0-9_-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case topicName = "TopicName"
        }
    }

    public struct RegisterEventTopicResult: AWSDecodableShape {
        public init() {}
    }

    public struct RejectSharedDirectoryRequest: AWSEncodableShape {
        /// Identifier of the shared directory in the directory consumer account. This identifier is different for each directory owner account.
        public let sharedDirectoryId: String

        public init(sharedDirectoryId: String) {
            self.sharedDirectoryId = sharedDirectoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.sharedDirectoryId, name: "sharedDirectoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectoryId = "SharedDirectoryId"
        }
    }

    public struct RejectSharedDirectoryResult: AWSDecodableShape {
        /// Identifier of the shared directory in the directory consumer account.
        public let sharedDirectoryId: String?

        public init(sharedDirectoryId: String? = nil) {
            self.sharedDirectoryId = sharedDirectoryId
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectoryId = "SharedDirectoryId"
        }
    }

    public struct RemoveIpRoutesRequest: AWSEncodableShape {
        /// IP address blocks that you want to remove.
        public let cidrIps: [String]
        /// Identifier (ID) of the directory from which you want to remove the IP addresses.
        public let directoryId: String

        public init(cidrIps: [String], directoryId: String) {
            self.cidrIps = cidrIps
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.cidrIps.forEach {
                try validate($0, name: "cidrIps[]", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([1-9]|[1-2][0-9]|3[0-2]))$")
            }
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case cidrIps = "CidrIps"
            case directoryId = "DirectoryId"
        }
    }

    public struct RemoveIpRoutesResult: AWSDecodableShape {
        public init() {}
    }

    public struct RemoveRegionRequest: AWSEncodableShape {
        /// The identifier of the directory for which you want to remove Region replication.
        public let directoryId: String

        public init(directoryId: String) {
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct RemoveRegionResult: AWSDecodableShape {
        public init() {}
    }

    public struct RemoveTagsFromResourceRequest: AWSEncodableShape {
        /// Identifier (ID) of the directory from which to remove the tag.
        public let resourceId: String
        /// The tag key (name) of the tag to be removed.
        public let tagKeys: [String]

        public init(resourceId: String, tagKeys: [String]) {
            self.resourceId = resourceId
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^[d]-[0-9a-f]{10}$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceId = "ResourceId"
            case tagKeys = "TagKeys"
        }
    }

    public struct RemoveTagsFromResourceResult: AWSDecodableShape {
        public init() {}
    }

    public struct ResetUserPasswordRequest: AWSEncodableShape {
        /// Identifier of the Managed Microsoft AD or Simple AD directory in which the user resides.
        public let directoryId: String
        /// The new password that will be reset.
        public let newPassword: String
        /// The user name of the user whose password will be reset.
        public let userName: String

        public init(directoryId: String, newPassword: String, userName: String) {
            self.directoryId = directoryId
            self.newPassword = newPassword
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.newPassword, name: "newPassword", parent: name, max: 127)
            try self.validate(self.newPassword, name: "newPassword", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, max: 64)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^(?!.*\\\\|.*\"|.*\\/|.*\\[|.*\\]|.*:|.*;|.*\\||.*=|.*,|.*\\+|.*\\*|.*\\?|.*<|.*>|.*@).*$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case newPassword = "NewPassword"
            case userName = "UserName"
        }
    }

    public struct ResetUserPasswordResult: AWSDecodableShape {
        public init() {}
    }

    public struct RestoreFromSnapshotRequest: AWSEncodableShape {
        /// The identifier of the snapshot to restore from.
        public let snapshotId: String

        public init(snapshotId: String) {
            self.snapshotId = snapshotId
        }

        public func validate(name: String) throws {
            try self.validate(self.snapshotId, name: "snapshotId", parent: name, pattern: "^s-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotId = "SnapshotId"
        }
    }

    public struct RestoreFromSnapshotResult: AWSDecodableShape {
        public init() {}
    }

    public struct SchemaExtensionInfo: AWSDecodableShape {
        /// A description of the schema extension.
        public let description: String?
        /// The identifier of the directory to which the schema extension is applied.
        public let directoryId: String?
        /// The date and time that the schema extension was completed.
        public let endDateTime: Date?
        /// The identifier of the schema extension.
        public let schemaExtensionId: String?
        /// The current status of the schema extension.
        public let schemaExtensionStatus: SchemaExtensionStatus?
        /// The reason for the SchemaExtensionStatus.
        public let schemaExtensionStatusReason: String?
        /// The date and time that the schema extension started being applied to the directory.
        public let startDateTime: Date?

        public init(description: String? = nil, directoryId: String? = nil, endDateTime: Date? = nil, schemaExtensionId: String? = nil, schemaExtensionStatus: SchemaExtensionStatus? = nil, schemaExtensionStatusReason: String? = nil, startDateTime: Date? = nil) {
            self.description = description
            self.directoryId = directoryId
            self.endDateTime = endDateTime
            self.schemaExtensionId = schemaExtensionId
            self.schemaExtensionStatus = schemaExtensionStatus
            self.schemaExtensionStatusReason = schemaExtensionStatusReason
            self.startDateTime = startDateTime
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case directoryId = "DirectoryId"
            case endDateTime = "EndDateTime"
            case schemaExtensionId = "SchemaExtensionId"
            case schemaExtensionStatus = "SchemaExtensionStatus"
            case schemaExtensionStatusReason = "SchemaExtensionStatusReason"
            case startDateTime = "StartDateTime"
        }
    }

    public struct Setting: AWSEncodableShape {
        /// The name of the directory setting. For example:  TLS_1_0
        public let name: String
        /// The value of the directory setting for which to retrieve information. For example, for TLS_1_0, the valid values are: Enable and Disable.
        public let value: String

        public init(name: String, value: String) {
            self.name = name
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-/. _]*$")
            try self.validate(self.value, name: "value", parent: name, max: 255)
            try self.validate(self.value, name: "value", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, pattern: "^[a-zA-Z0-9]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct SettingEntry: AWSDecodableShape {
        /// The valid range of values for the directory setting.
        public let allowedValues: String?
        /// The value of the directory setting that is applied to the directory.
        public let appliedValue: String?
        /// The date and time when the request to update a directory setting was last submitted.
        public let lastRequestedDateTime: Date?
        /// The date and time when the directory setting was last updated.
        public let lastUpdatedDateTime: Date?
        /// The name of the directory setting. For example:  TLS_1_0
        public let name: String?
        /// Details about the status of the request to update the directory setting. If the directory setting is deployed in more than one region, status is returned for the request in each region where the setting is deployed.
        public let requestDetailedStatus: [String: DirectoryConfigurationStatus]?
        /// The value that was last requested for the directory setting.
        public let requestedValue: String?
        /// The overall status of the request to update the directory setting request. If the directory setting is deployed in more than one region, and the request fails in any region, the overall status is Failed.
        public let requestStatus: DirectoryConfigurationStatus?
        /// The last status message for the directory status request.
        public let requestStatusMessage: String?
        /// The type of directory setting. For example, Protocol or Cipher.
        public let type: String?

        public init(allowedValues: String? = nil, appliedValue: String? = nil, lastRequestedDateTime: Date? = nil, lastUpdatedDateTime: Date? = nil, name: String? = nil, requestDetailedStatus: [String: DirectoryConfigurationStatus]? = nil, requestedValue: String? = nil, requestStatus: DirectoryConfigurationStatus? = nil, requestStatusMessage: String? = nil, type: String? = nil) {
            self.allowedValues = allowedValues
            self.appliedValue = appliedValue
            self.lastRequestedDateTime = lastRequestedDateTime
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.name = name
            self.requestDetailedStatus = requestDetailedStatus
            self.requestedValue = requestedValue
            self.requestStatus = requestStatus
            self.requestStatusMessage = requestStatusMessage
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case allowedValues = "AllowedValues"
            case appliedValue = "AppliedValue"
            case lastRequestedDateTime = "LastRequestedDateTime"
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case name = "Name"
            case requestDetailedStatus = "RequestDetailedStatus"
            case requestedValue = "RequestedValue"
            case requestStatus = "RequestStatus"
            case requestStatusMessage = "RequestStatusMessage"
            case type = "Type"
        }
    }

    public struct ShareDirectoryRequest: AWSEncodableShape {
        /// Identifier of the Managed Microsoft AD directory that you want to share with other Amazon Web Services accounts.
        public let directoryId: String
        /// The method used when sharing a directory to determine whether the directory should be shared within your Amazon Web Services organization (ORGANIZATIONS) or with any Amazon Web Services account by sending a directory sharing request (HANDSHAKE).
        public let shareMethod: ShareMethod
        /// A directory share request that is sent by the directory owner to the directory consumer. The request includes a typed message to help the directory consumer administrator determine whether to approve or reject the share invitation.
        public let shareNotes: String?
        /// Identifier for the directory consumer account with whom the directory is to be shared.
        public let shareTarget: ShareTarget

        public init(directoryId: String, shareMethod: ShareMethod, shareNotes: String? = nil, shareTarget: ShareTarget) {
            self.directoryId = directoryId
            self.shareMethod = shareMethod
            self.shareNotes = shareNotes
            self.shareTarget = shareTarget
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.shareNotes, name: "shareNotes", parent: name, max: 1024)
            try self.shareTarget.validate(name: "\(name).shareTarget")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case shareMethod = "ShareMethod"
            case shareNotes = "ShareNotes"
            case shareTarget = "ShareTarget"
        }
    }

    public struct ShareDirectoryResult: AWSDecodableShape {
        /// Identifier of the directory that is stored in the directory consumer account that is shared from the specified directory (DirectoryId).
        public let sharedDirectoryId: String?

        public init(sharedDirectoryId: String? = nil) {
            self.sharedDirectoryId = sharedDirectoryId
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectoryId = "SharedDirectoryId"
        }
    }

    public struct ShareTarget: AWSEncodableShape {
        /// Identifier of the directory consumer account.
        public let id: String
        /// Type of identifier to be used in the Id field.
        public let type: TargetType

        public init(id: String, type: TargetType) {
            self.id = id
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 64)
            try self.validate(self.id, name: "id", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case type = "Type"
        }
    }

    public struct SharedDirectory: AWSDecodableShape {
        /// The date and time that the shared directory was created.
        public let createdDateTime: Date?
        /// The date and time that the shared directory was last updated.
        public let lastUpdatedDateTime: Date?
        /// Identifier of the directory owner account, which contains the directory that has been shared to the consumer account.
        public let ownerAccountId: String?
        /// Identifier of the directory in the directory owner account.
        public let ownerDirectoryId: String?
        /// Identifier of the directory consumer account that has access to the shared directory (OwnerDirectoryId) in the directory owner account.
        public let sharedAccountId: String?
        /// Identifier of the shared directory in the directory consumer account. This identifier is different for each directory owner account.
        public let sharedDirectoryId: String?
        /// The method used when sharing a directory to determine whether the directory should be shared within your Amazon Web Services organization (ORGANIZATIONS) or with any Amazon Web Services account by sending a shared directory request (HANDSHAKE).
        public let shareMethod: ShareMethod?
        /// A directory share request that is sent by the directory owner to the directory consumer. The request includes a typed message to help the directory consumer administrator determine whether to approve or reject the share invitation.
        public let shareNotes: String?
        /// Current directory status of the shared Managed Microsoft AD directory.
        public let shareStatus: ShareStatus?

        public init(createdDateTime: Date? = nil, lastUpdatedDateTime: Date? = nil, ownerAccountId: String? = nil, ownerDirectoryId: String? = nil, sharedAccountId: String? = nil, sharedDirectoryId: String? = nil, shareMethod: ShareMethod? = nil, shareNotes: String? = nil, shareStatus: ShareStatus? = nil) {
            self.createdDateTime = createdDateTime
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.ownerAccountId = ownerAccountId
            self.ownerDirectoryId = ownerDirectoryId
            self.sharedAccountId = sharedAccountId
            self.sharedDirectoryId = sharedDirectoryId
            self.shareMethod = shareMethod
            self.shareNotes = shareNotes
            self.shareStatus = shareStatus
        }

        private enum CodingKeys: String, CodingKey {
            case createdDateTime = "CreatedDateTime"
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case ownerAccountId = "OwnerAccountId"
            case ownerDirectoryId = "OwnerDirectoryId"
            case sharedAccountId = "SharedAccountId"
            case sharedDirectoryId = "SharedDirectoryId"
            case shareMethod = "ShareMethod"
            case shareNotes = "ShareNotes"
            case shareStatus = "ShareStatus"
        }
    }

    public struct Snapshot: AWSDecodableShape {
        /// The directory identifier.
        public let directoryId: String?
        /// The descriptive name of the snapshot.
        public let name: String?
        /// The snapshot identifier.
        public let snapshotId: String?
        /// The date and time that the snapshot was taken.
        public let startTime: Date?
        /// The snapshot status.
        public let status: SnapshotStatus?
        /// The snapshot type.
        public let type: SnapshotType?

        public init(directoryId: String? = nil, name: String? = nil, snapshotId: String? = nil, startTime: Date? = nil, status: SnapshotStatus? = nil, type: SnapshotType? = nil) {
            self.directoryId = directoryId
            self.name = name
            self.snapshotId = snapshotId
            self.startTime = startTime
            self.status = status
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case name = "Name"
            case snapshotId = "SnapshotId"
            case startTime = "StartTime"
            case status = "Status"
            case type = "Type"
        }
    }

    public struct SnapshotLimits: AWSDecodableShape {
        /// The current number of manual snapshots of the directory.
        public let manualSnapshotsCurrentCount: Int?
        /// The maximum number of manual snapshots allowed.
        public let manualSnapshotsLimit: Int?
        /// Indicates if the manual snapshot limit has been reached.
        public let manualSnapshotsLimitReached: Bool?

        public init(manualSnapshotsCurrentCount: Int? = nil, manualSnapshotsLimit: Int? = nil, manualSnapshotsLimitReached: Bool? = nil) {
            self.manualSnapshotsCurrentCount = manualSnapshotsCurrentCount
            self.manualSnapshotsLimit = manualSnapshotsLimit
            self.manualSnapshotsLimitReached = manualSnapshotsLimitReached
        }

        private enum CodingKeys: String, CodingKey {
            case manualSnapshotsCurrentCount = "ManualSnapshotsCurrentCount"
            case manualSnapshotsLimit = "ManualSnapshotsLimit"
            case manualSnapshotsLimitReached = "ManualSnapshotsLimitReached"
        }
    }

    public struct StartSchemaExtensionRequest: AWSEncodableShape {
        /// If true, creates a snapshot of the directory before applying the schema extension.
        public let createSnapshotBeforeSchemaExtension: Bool
        /// A description of the schema extension.
        public let description: String
        /// The identifier of the directory for which the schema extension will be applied to.
        public let directoryId: String
        /// The LDIF file represented as a string. To construct the LdifContent string, precede each line as it would be formatted in an ldif file with \n. See the example request below for more details. The file size can be no larger than 1MB.
        public let ldifContent: String

        public init(createSnapshotBeforeSchemaExtension: Bool = false, description: String, directoryId: String, ldifContent: String) {
            self.createSnapshotBeforeSchemaExtension = createSnapshotBeforeSchemaExtension
            self.description = description
            self.directoryId = directoryId
            self.ldifContent = ldifContent
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 128)
            try self.validate(self.description, name: "description", parent: name, pattern: "^([a-zA-Z0-9_])[\\\\a-zA-Z0-9_@#%*+=:?./!\\s-]*$")
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.validate(self.ldifContent, name: "ldifContent", parent: name, max: 500_000)
            try self.validate(self.ldifContent, name: "ldifContent", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case createSnapshotBeforeSchemaExtension = "CreateSnapshotBeforeSchemaExtension"
            case description = "Description"
            case directoryId = "DirectoryId"
            case ldifContent = "LdifContent"
        }
    }

    public struct StartSchemaExtensionResult: AWSDecodableShape {
        /// The identifier of the schema extension that will be applied.
        public let schemaExtensionId: String?

        public init(schemaExtensionId: String? = nil) {
            self.schemaExtensionId = schemaExtensionId
        }

        private enum CodingKeys: String, CodingKey {
            case schemaExtensionId = "SchemaExtensionId"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").
        public let key: String
        /// The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct Trust: AWSDecodableShape {
        /// The date and time that the trust relationship was created.
        public let createdDateTime: Date?
        /// The Directory ID of the Amazon Web Services directory involved in the trust relationship.
        public let directoryId: String?
        /// The date and time that the trust relationship was last updated.
        public let lastUpdatedDateTime: Date?
        /// The Fully Qualified Domain Name (FQDN) of the external domain involved in the trust relationship.
        public let remoteDomainName: String?
        /// Current state of selective authentication for the trust.
        public let selectiveAuth: SelectiveAuth?
        /// The date and time that the TrustState was last updated.
        public let stateLastUpdatedDateTime: Date?
        /// The trust relationship direction.
        public let trustDirection: TrustDirection?
        /// The unique ID of the trust relationship.
        public let trustId: String?
        /// The trust relationship state.
        public let trustState: TrustState?
        /// The reason for the TrustState.
        public let trustStateReason: String?
        /// The trust relationship type. Forest is the default.
        public let trustType: TrustType?

        public init(createdDateTime: Date? = nil, directoryId: String? = nil, lastUpdatedDateTime: Date? = nil, remoteDomainName: String? = nil, selectiveAuth: SelectiveAuth? = nil, stateLastUpdatedDateTime: Date? = nil, trustDirection: TrustDirection? = nil, trustId: String? = nil, trustState: TrustState? = nil, trustStateReason: String? = nil, trustType: TrustType? = nil) {
            self.createdDateTime = createdDateTime
            self.directoryId = directoryId
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.remoteDomainName = remoteDomainName
            self.selectiveAuth = selectiveAuth
            self.stateLastUpdatedDateTime = stateLastUpdatedDateTime
            self.trustDirection = trustDirection
            self.trustId = trustId
            self.trustState = trustState
            self.trustStateReason = trustStateReason
            self.trustType = trustType
        }

        private enum CodingKeys: String, CodingKey {
            case createdDateTime = "CreatedDateTime"
            case directoryId = "DirectoryId"
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case remoteDomainName = "RemoteDomainName"
            case selectiveAuth = "SelectiveAuth"
            case stateLastUpdatedDateTime = "StateLastUpdatedDateTime"
            case trustDirection = "TrustDirection"
            case trustId = "TrustId"
            case trustState = "TrustState"
            case trustStateReason = "TrustStateReason"
            case trustType = "TrustType"
        }
    }

    public struct UnshareDirectoryRequest: AWSEncodableShape {
        /// The identifier of the Managed Microsoft AD directory that you want to stop sharing.
        public let directoryId: String
        /// Identifier for the directory consumer account with whom the directory has to be unshared.
        public let unshareTarget: UnshareTarget

        public init(directoryId: String, unshareTarget: UnshareTarget) {
            self.directoryId = directoryId
            self.unshareTarget = unshareTarget
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.unshareTarget.validate(name: "\(name).unshareTarget")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case unshareTarget = "UnshareTarget"
        }
    }

    public struct UnshareDirectoryResult: AWSDecodableShape {
        /// Identifier of the directory stored in the directory consumer account that is to be unshared from the specified directory (DirectoryId).
        public let sharedDirectoryId: String?

        public init(sharedDirectoryId: String? = nil) {
            self.sharedDirectoryId = sharedDirectoryId
        }

        private enum CodingKeys: String, CodingKey {
            case sharedDirectoryId = "SharedDirectoryId"
        }
    }

    public struct UnshareTarget: AWSEncodableShape {
        /// Identifier of the directory consumer account.
        public let id: String
        /// Type of identifier to be used in the Id field.
        public let type: TargetType

        public init(id: String, type: TargetType) {
            self.id = id
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 64)
            try self.validate(self.id, name: "id", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case type = "Type"
        }
    }

    public struct UpdateConditionalForwarderRequest: AWSEncodableShape {
        /// The directory ID of the Amazon Web Services directory for which to update the conditional forwarder.
        public let directoryId: String
        /// The updated IP addresses of the remote DNS server associated with the conditional forwarder.
        public let dnsIpAddrs: [String]
        /// The fully qualified domain name (FQDN) of the remote domain with which you will set up a trust relationship.
        public let remoteDomainName: String

        public init(directoryId: String, dnsIpAddrs: [String], remoteDomainName: String) {
            self.directoryId = directoryId
            self.dnsIpAddrs = dnsIpAddrs
            self.remoteDomainName = remoteDomainName
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.dnsIpAddrs.forEach {
                try validate($0, name: "dnsIpAddrs[]", parent: name, pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
            }
            try self.validate(self.remoteDomainName, name: "remoteDomainName", parent: name, pattern: "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case dnsIpAddrs = "DnsIpAddrs"
            case remoteDomainName = "RemoteDomainName"
        }
    }

    public struct UpdateConditionalForwarderResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateDirectorySetupRequest: AWSEncodableShape {
        ///  The boolean that specifies if a snapshot for the directory needs to be taken before updating the directory.
        public let createSnapshotBeforeUpdate: Bool?
        ///  The identifier of the directory on which you want to perform the update.
        public let directoryId: String
        ///  The settings for the OS update that needs to be performed on the directory.
        public let osUpdateSettings: OSUpdateSettings?
        ///  The type of update that needs to be performed on the directory. For example, OS.
        public let updateType: UpdateType

        public init(createSnapshotBeforeUpdate: Bool? = nil, directoryId: String, osUpdateSettings: OSUpdateSettings? = nil, updateType: UpdateType) {
            self.createSnapshotBeforeUpdate = createSnapshotBeforeUpdate
            self.directoryId = directoryId
            self.osUpdateSettings = osUpdateSettings
            self.updateType = updateType
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case createSnapshotBeforeUpdate = "CreateSnapshotBeforeUpdate"
            case directoryId = "DirectoryId"
            case osUpdateSettings = "OSUpdateSettings"
            case updateType = "UpdateType"
        }
    }

    public struct UpdateDirectorySetupResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateInfoEntry: AWSDecodableShape {
        ///  This specifies if the update was initiated by the customer or by the service team.
        public let initiatedBy: String?
        ///  The last updated date and time of a particular directory setting.
        public let lastUpdatedDateTime: Date?
        ///  The new value of the target setting.
        public let newValue: UpdateValue?
        ///  The old value of the target setting.
        public let previousValue: UpdateValue?
        ///  The name of the Region.
        public let region: String?
        ///  The start time of the UpdateDirectorySetup for the particular type.
        public let startTime: Date?
        ///  The status of the update performed on the directory.
        public let status: UpdateStatus?
        ///  The reason for the current status of the update type activity.
        public let statusReason: String?

        public init(initiatedBy: String? = nil, lastUpdatedDateTime: Date? = nil, newValue: UpdateValue? = nil, previousValue: UpdateValue? = nil, region: String? = nil, startTime: Date? = nil, status: UpdateStatus? = nil, statusReason: String? = nil) {
            self.initiatedBy = initiatedBy
            self.lastUpdatedDateTime = lastUpdatedDateTime
            self.newValue = newValue
            self.previousValue = previousValue
            self.region = region
            self.startTime = startTime
            self.status = status
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedBy = "InitiatedBy"
            case lastUpdatedDateTime = "LastUpdatedDateTime"
            case newValue = "NewValue"
            case previousValue = "PreviousValue"
            case region = "Region"
            case startTime = "StartTime"
            case status = "Status"
            case statusReason = "StatusReason"
        }
    }

    public struct UpdateNumberOfDomainControllersRequest: AWSEncodableShape {
        /// The number of domain controllers desired in the directory.
        public let desiredNumber: Int
        /// Identifier of the directory to which the domain controllers will be added or removed.
        public let directoryId: String

        public init(desiredNumber: Int = 0, directoryId: String) {
            self.desiredNumber = desiredNumber
            self.directoryId = directoryId
        }

        public func validate(name: String) throws {
            try self.validate(self.desiredNumber, name: "desiredNumber", parent: name, min: 2)
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case desiredNumber = "DesiredNumber"
            case directoryId = "DirectoryId"
        }
    }

    public struct UpdateNumberOfDomainControllersResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateRadiusRequest: AWSEncodableShape {
        /// The identifier of the directory for which to update the RADIUS server information.
        public let directoryId: String
        /// A RadiusSettings object that contains information about the RADIUS server.
        public let radiusSettings: RadiusSettings

        public init(directoryId: String, radiusSettings: RadiusSettings) {
            self.directoryId = directoryId
            self.radiusSettings = radiusSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.radiusSettings.validate(name: "\(name).radiusSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case radiusSettings = "RadiusSettings"
        }
    }

    public struct UpdateRadiusResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateSettingsRequest: AWSEncodableShape {
        /// The identifier of the directory for which to update settings.
        public let directoryId: String
        /// The list of Setting objects.
        public let settings: [Setting]

        public init(directoryId: String, settings: [Setting]) {
            self.directoryId = directoryId
            self.settings = settings
        }

        public func validate(name: String) throws {
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.settings.forEach {
                try $0.validate(name: "\(name).settings[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
            case settings = "Settings"
        }
    }

    public struct UpdateSettingsResult: AWSDecodableShape {
        /// The identifier of the directory.
        public let directoryId: String?

        public init(directoryId: String? = nil) {
            self.directoryId = directoryId
        }

        private enum CodingKeys: String, CodingKey {
            case directoryId = "DirectoryId"
        }
    }

    public struct UpdateTrustRequest: AWSEncodableShape {
        /// Updates selective authentication for the trust.
        public let selectiveAuth: SelectiveAuth?
        /// Identifier of the trust relationship.
        public let trustId: String

        public init(selectiveAuth: SelectiveAuth? = nil, trustId: String) {
            self.selectiveAuth = selectiveAuth
            self.trustId = trustId
        }

        public func validate(name: String) throws {
            try self.validate(self.trustId, name: "trustId", parent: name, pattern: "^t-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case selectiveAuth = "SelectiveAuth"
            case trustId = "TrustId"
        }
    }

    public struct UpdateTrustResult: AWSDecodableShape {
        public let requestId: String?
        /// Identifier of the trust relationship.
        public let trustId: String?

        public init(requestId: String? = nil, trustId: String? = nil) {
            self.requestId = requestId
            self.trustId = trustId
        }

        private enum CodingKeys: String, CodingKey {
            case requestId = "RequestId"
            case trustId = "TrustId"
        }
    }

    public struct UpdateValue: AWSDecodableShape {
        ///  The OS update related settings.
        public let osUpdateSettings: OSUpdateSettings?

        public init(osUpdateSettings: OSUpdateSettings? = nil) {
            self.osUpdateSettings = osUpdateSettings
        }

        private enum CodingKeys: String, CodingKey {
            case osUpdateSettings = "OSUpdateSettings"
        }
    }

    public struct VerifyTrustRequest: AWSEncodableShape {
        /// The unique Trust ID of the trust relationship to verify.
        public let trustId: String

        public init(trustId: String) {
            self.trustId = trustId
        }

        public func validate(name: String) throws {
            try self.validate(self.trustId, name: "trustId", parent: name, pattern: "^t-[0-9a-f]{10}$")
        }

        private enum CodingKeys: String, CodingKey {
            case trustId = "TrustId"
        }
    }

    public struct VerifyTrustResult: AWSDecodableShape {
        /// The unique Trust ID of the trust relationship that was verified.
        public let trustId: String?

        public init(trustId: String? = nil) {
            self.trustId = trustId
        }

        private enum CodingKeys: String, CodingKey {
            case trustId = "TrustId"
        }
    }
}

// MARK: - Errors

/// Error enum for DirectoryService
public struct DirectoryServiceErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case authenticationFailedException = "AuthenticationFailedException"
        case certificateAlreadyExistsException = "CertificateAlreadyExistsException"
        case certificateDoesNotExistException = "CertificateDoesNotExistException"
        case certificateInUseException = "CertificateInUseException"
        case certificateLimitExceededException = "CertificateLimitExceededException"
        case clientException = "ClientException"
        case directoryAlreadyInRegionException = "DirectoryAlreadyInRegionException"
        case directoryAlreadySharedException = "DirectoryAlreadySharedException"
        case directoryDoesNotExistException = "DirectoryDoesNotExistException"
        case directoryInDesiredStateException = "DirectoryInDesiredStateException"
        case directoryLimitExceededException = "DirectoryLimitExceededException"
        case directoryNotSharedException = "DirectoryNotSharedException"
        case directoryUnavailableException = "DirectoryUnavailableException"
        case domainControllerLimitExceededException = "DomainControllerLimitExceededException"
        case entityAlreadyExistsException = "EntityAlreadyExistsException"
        case entityDoesNotExistException = "EntityDoesNotExistException"
        case incompatibleSettingsException = "IncompatibleSettingsException"
        case insufficientPermissionsException = "InsufficientPermissionsException"
        case invalidCertificateException = "InvalidCertificateException"
        case invalidClientAuthStatusException = "InvalidClientAuthStatusException"
        case invalidLDAPSStatusException = "InvalidLDAPSStatusException"
        case invalidNextTokenException = "InvalidNextTokenException"
        case invalidParameterException = "InvalidParameterException"
        case invalidPasswordException = "InvalidPasswordException"
        case invalidTargetException = "InvalidTargetException"
        case ipRouteLimitExceededException = "IpRouteLimitExceededException"
        case noAvailableCertificateException = "NoAvailableCertificateException"
        case organizationsException = "OrganizationsException"
        case regionLimitExceededException = "RegionLimitExceededException"
        case serviceException = "ServiceException"
        case shareLimitExceededException = "ShareLimitExceededException"
        case snapshotLimitExceededException = "SnapshotLimitExceededException"
        case tagLimitExceededException = "TagLimitExceededException"
        case unsupportedOperationException = "UnsupportedOperationException"
        case unsupportedSettingsException = "UnsupportedSettingsException"
        case userDoesNotExistException = "UserDoesNotExistException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize DirectoryService
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// Client authentication is not available in this region at this time.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// An authentication error occurred.
    public static var authenticationFailedException: Self { .init(.authenticationFailedException) }
    /// The certificate has already been registered into the system.
    public static var certificateAlreadyExistsException: Self { .init(.certificateAlreadyExistsException) }
    /// The certificate is not present in the system for describe or deregister activities.
    public static var certificateDoesNotExistException: Self { .init(.certificateDoesNotExistException) }
    /// The certificate is being used for the LDAP security connection and cannot be removed without disabling LDAP security.
    public static var certificateInUseException: Self { .init(.certificateInUseException) }
    /// The certificate could not be added because the certificate limit has been reached.
    public static var certificateLimitExceededException: Self { .init(.certificateLimitExceededException) }
    /// A client exception has occurred.
    public static var clientException: Self { .init(.clientException) }
    /// The Region you specified is the same Region where the Managed Microsoft AD directory was created. Specify a different Region and try again.
    public static var directoryAlreadyInRegionException: Self { .init(.directoryAlreadyInRegionException) }
    /// The specified directory has already been shared with this Amazon Web Services account.
    public static var directoryAlreadySharedException: Self { .init(.directoryAlreadySharedException) }
    /// The specified directory does not exist in the system.
    public static var directoryDoesNotExistException: Self { .init(.directoryDoesNotExistException) }
    ///  The directory is already updated to desired update type settings.
    public static var directoryInDesiredStateException: Self { .init(.directoryInDesiredStateException) }
    /// The maximum number of directories in the region has been reached. You can use the GetDirectoryLimits operation to determine your directory limits in the region.
    public static var directoryLimitExceededException: Self { .init(.directoryLimitExceededException) }
    /// The specified directory has not been shared with this Amazon Web Services account.
    public static var directoryNotSharedException: Self { .init(.directoryNotSharedException) }
    /// The specified directory is unavailable or could not be found.
    public static var directoryUnavailableException: Self { .init(.directoryUnavailableException) }
    /// The maximum allowed number of domain controllers per directory was exceeded. The default limit per directory is 20 domain controllers.
    public static var domainControllerLimitExceededException: Self { .init(.domainControllerLimitExceededException) }
    /// The specified entity already exists.
    public static var entityAlreadyExistsException: Self { .init(.entityAlreadyExistsException) }
    /// The specified entity could not be found.
    public static var entityDoesNotExistException: Self { .init(.entityDoesNotExistException) }
    /// The specified directory setting is not compatible with other settings.
    public static var incompatibleSettingsException: Self { .init(.incompatibleSettingsException) }
    /// The account does not have sufficient permission to perform the operation.
    public static var insufficientPermissionsException: Self { .init(.insufficientPermissionsException) }
    /// The certificate PEM that was provided has incorrect encoding.
    public static var invalidCertificateException: Self { .init(.invalidCertificateException) }
    /// Client authentication is already enabled.
    public static var invalidClientAuthStatusException: Self { .init(.invalidClientAuthStatusException) }
    /// The LDAP activities could not be performed because they are limited by the LDAPS status.
    public static var invalidLDAPSStatusException: Self { .init(.invalidLDAPSStatusException) }
    /// The NextToken value is not valid.
    public static var invalidNextTokenException: Self { .init(.invalidNextTokenException) }
    /// One or more parameters are not valid.
    public static var invalidParameterException: Self { .init(.invalidParameterException) }
    /// The new password provided by the user does not meet the password complexity requirements defined in your directory.
    public static var invalidPasswordException: Self { .init(.invalidPasswordException) }
    /// The specified shared target is not valid.
    public static var invalidTargetException: Self { .init(.invalidTargetException) }
    /// The maximum allowed number of IP addresses was exceeded. The default limit is 100 IP address blocks.
    public static var ipRouteLimitExceededException: Self { .init(.ipRouteLimitExceededException) }
    /// Client authentication setup could not be completed because at least one valid certificate must be registered in the system.
    public static var noAvailableCertificateException: Self { .init(.noAvailableCertificateException) }
    /// Exception encountered while trying to access your Amazon Web Services organization.
    public static var organizationsException: Self { .init(.organizationsException) }
    /// You have reached the limit for maximum number of simultaneous Region replications per directory.
    public static var regionLimitExceededException: Self { .init(.regionLimitExceededException) }
    /// An exception has occurred in Directory Service.
    public static var serviceException: Self { .init(.serviceException) }
    /// The maximum number of Amazon Web Services accounts that you can share with this directory has been reached.
    public static var shareLimitExceededException: Self { .init(.shareLimitExceededException) }
    /// The maximum number of manual snapshots for the directory has been reached. You can use the GetSnapshotLimits operation to determine the snapshot limits for a directory.
    public static var snapshotLimitExceededException: Self { .init(.snapshotLimitExceededException) }
    /// The maximum allowed number of tags was exceeded.
    public static var tagLimitExceededException: Self { .init(.tagLimitExceededException) }
    /// The operation is not supported.
    public static var unsupportedOperationException: Self { .init(.unsupportedOperationException) }
    /// The specified directory setting is not supported.
    public static var unsupportedSettingsException: Self { .init(.unsupportedSettingsException) }
    /// The user provided a username that does not exist in your directory.
    public static var userDoesNotExistException: Self { .init(.userDoesNotExistException) }
}

extension DirectoryServiceErrorType: Equatable {
    public static func == (lhs: DirectoryServiceErrorType, rhs: DirectoryServiceErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension DirectoryServiceErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
